zulip-terminal icon indicating copy to clipboard operation
zulip-terminal copied to clipboard

Adding new stream throws an Keyerror

Open aryanshridhar opened this issue 4 years ago • 8 comments

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

aryanshridhar avatar Oct 28 '20 17:10 aryanshridhar

@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?

neiljp avatar Oct 28 '20 19:10 neiljp

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

aryanshridhar avatar Oct 28 '20 19:10 aryanshridhar

@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.

neiljp avatar Oct 28 '20 20:10 neiljp

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

$ zulip-term -v
Zulip Terminal 0.5.2+git

aryanshridhar avatar Oct 29 '20 17:10 aryanshridhar

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

Abhirup-99 avatar Dec 10 '20 09:12 Abhirup-99

@zulipbot claim

theViz343 avatar Apr 21 '23 19:04 theViz343

@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 avatar May 01 '23 21:05 zulipbot

@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 avatar Jun 25 '23 09:06 zulipbot