Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new stream throws an Keyerror #816

Open
aryanshridhar opened this issue Oct 28, 2020 · 8 comments · May be fixed by #851, #1387, #1430 or #1419
Open

Adding new stream throws an Keyerror #816

aryanshridhar opened this issue Oct 28, 2020 · 8 comments · May be fixed by #851, #1387, #1430 or #1419
Labels
bug Something isn't working help wanted This issue should be clear enough to work on high priority should be done as soon as possible

Comments

@aryanshridhar
Copy link
Member

aryanshridhar commented Oct 28, 2020

Whenever an admin adds an extra stream in the server , an error is thrown if a message in received the newly added stream as :
Screenshot

Traceback :

Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/aryanshridhar/Desktop/zulip-terminal-env/zulip-terminal/zulipterminal/model.py", line 1194, in poll_for_events
    self.event_actions[event['type']](event)
  File "/home/aryanshridhar/Desktop/zulip-terminal-env/zulip-terminal/zulipterminal/model.py", line 918, in _handle_message_event
    set_count([message['id']], self.controller, 1)
  File "/home/aryanshridhar/Desktop/zulip-terminal-env/zulip-terminal/zulipterminal/helper.py", line 249, in set_count
    _set_count_in_view(controller, new_count, changed_messages, unread_counts)
  File "/home/aryanshridhar/Desktop/zulip-terminal-env/zulip-terminal/zulipterminal/helper.py", line 214, in _set_count_in_view
    if controller.model.is_muted_topic(stream_id, msg_topic):
  File "/home/aryanshridhar/Desktop/zulip-terminal-env/zulip-terminal/zulipterminal/model.py", line 474, in is_muted_topic
    stream_name = self.stream_dict[stream_id]['name']
KeyError: 263064

To reproduce :

  • Create a new stream in the server .
  • Add (Reply/New topic) an message in the newly created stream .
  • Checkout the zulip terminal (which was active throughout the process) .

Zulip-version :

$ zulip-term -v
Zulip Terminal 0.5.2
@neiljp neiljp added the bug Something isn't working label Oct 28, 2020
@neiljp
Copy link
Collaborator

neiljp commented Oct 28, 2020

@aryanshridhar Thanks for the bug report! We definitely don't handle certain stream events, so I expect this could be related to that.

What version of zulip-terminal are you running?

@aryanshridhar
Copy link
Member Author

Oh Fine @neiljp , I have updated the issue with the same .

@neiljp
Copy link
Collaborator

neiljp commented Oct 28, 2020

@aryanshridhar I've not tested your case against the latest development version of ZT in git, but it may be more stable - I know we added some checks for unsubscribed streams at least.

It is still possible that this bug exists in the git version however, and certainly won't currently update the list of streams subscribed to - we need to handle more stream events in any case. I was looking into this in the last week or so.

@aryanshridhar
Copy link
Member Author

Yup , The error exists in the git version as well .

$ zulip-term -v
Zulip Terminal 0.5.2+git

@neiljp neiljp added the high priority should be done as soon as possible label Nov 22, 2020
@Abhirup-99
Copy link
Contributor

@neiljp what's the status of this issue? Can I work on this?

@Abhirup-99 Abhirup-99 linked a pull request Dec 15, 2020 that will close this issue
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Dec 19, 2020
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Dec 22, 2020
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Jan 9, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Jan 30, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Jan 31, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Jan 31, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 8, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 8, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 11, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Feb 18, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 11, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 13, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 13, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 27, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 29, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 29, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 29, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 29, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 30, 2021
Abhirup-99 added a commit to Abhirup-99/zulip-terminal that referenced this issue Mar 30, 2021
@neiljp neiljp added the help wanted This issue should be clear enough to work on label Apr 8, 2023
@theViz343
Copy link
Member

@zulipbot claim

@theViz343 theViz343 linked a pull request Apr 24, 2023 that will close this issue
21 tasks
@zulipbot
Copy link
Member

zulipbot commented May 1, 2023

@theViz343 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

@zulipbot
Copy link
Member

zulipbot commented Jun 25, 2023

@theViz343 You have been unassigned from this issue because you have not made any updates for over 14 days. Please feel free to reclaim the issue if you decide to pick up again. Thanks!

theViz343 added a commit to theViz343/zulip-terminal that referenced this issue Jul 27, 2023
This commit replaces the direct use of stream_dict to access the 'name'
property, with the stream accessor function introduced in the earlier
commit.
Since the new stream accessor function accesses subscribed streams, was
subscribed streams and never-subscribed stream, the keyerror issue
described in issue zulip#816 is resolved.
theViz343 added a commit to theViz343/zulip-terminal that referenced this issue Jul 27, 2023
This commit replaces the direct use of stream_dict to access the 'name'
property, with the stream accessor function introduced in the earlier
commit.
Since the new stream accessor function accesses subscribed streams, was
subscribed streams and never-subscribed stream, the keyerror issue
described in issue zulip#816 is resolved.
@theViz343 theViz343 linked a pull request Jul 27, 2023 that will close this issue
18 tasks
theViz343 added a commit to theViz343/zulip-terminal that referenced this issue Jul 27, 2023
This commit replaces the direct use of stream_dict to access the 'name'
property, with the stream accessor function introduced in the earlier
commit.
Since the new stream accessor function accesses subscribed streams, was
subscribed streams and never-subscribed stream, the keyerror issue
described in issue zulip#816 is resolved.
theViz343 added a commit to theViz343/zulip-terminal that referenced this issue Aug 2, 2023
This commit replaces the direct use of stream_dict to access the 'name'
property, with the stream accessor function introduced in the earlier
commit.
Since the new stream accessor function accesses subscribed streams, was
subscribed streams and never-subscribed stream, the keyerror issue
described in issue zulip#816 is resolved.
theViz343 added a commit to theViz343/zulip-terminal that referenced this issue Aug 28, 2023
This commit replaces the direct use of stream_dict to access the 'name'
property, with the stream accessor function introduced in the earlier
commit.
Since the new stream accessor function accesses subscribed streams, was
subscribed streams and never-subscribed stream, the keyerror issue
described in issue zulip#816 is resolved.
@theViz343 theViz343 linked a pull request Sep 17, 2023 that will close this issue
19 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted This issue should be clear enough to work on high priority should be done as soon as possible
Projects
None yet
5 participants