-
-
Notifications
You must be signed in to change notification settings - Fork 273
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
KeyError: 'flags' #920
Comments
I also hit this, but don't know why. (Zulip-Terminal in screen in Gnome Terminal, checked out from git today.) |
Bumping the priority, since I happened to encounter the same bug twice today. Trying to figure out a quick fix too... |
After a little debugging, I can now reproduce this via:
A small fix appears to resolve this well, and I'm going to do a small PR and merge shortly, though we may want to consider our use of defaultdict more generally, at least in certain datastructures. |
This updates an approach taken in the original reaction implementation. Since locally cached messages are currently stored in a `defaultdict`, direct indexing with a non-present message-id creates an empty message. Such messages then generate `KeyError`s when flags are updated later (eg. marking read, toggling star status), if the message has not been fetched. Fixes zulip#920.
This updates an approach taken in the original reaction implementation. Since locally cached messages are currently stored in a `defaultdict`, direct indexing with a non-present message-id creates an empty message. Such messages then generate `KeyError`s when flags are updated later (eg. marking read, toggling star status), if the message has not been fetched. Tests updated to explicitly exclude generation of empty index for reaction events. Fixes zulip#920.
This updates an approach taken in the original reaction implementation. Since locally cached messages are currently stored in a `defaultdict`, direct indexing with a non-present message-id creates an empty message. Such messages then generate `KeyError`s when flags are updated later (eg. marking read, toggling star status), if the message has not been fetched. Tests updated to explicitly exclude generation of empty index for reaction events. Fixes #920.
The following error was in my zulip-terminal-thread-exceptions.log:
Traceback (most recent call last):
File "/Users/kellyfoulk/Documents/code/zulip-terminal/zulipterminal/model.py", line 1265, in poll_for_events
self.event_actionsevent['type']
File "/Users/kellyfoulk/Documents/code/zulip-terminal/zulipterminal/model.py", line 1124, in _handle_update_message_flags_event
if flag_to_change not in msg['flags']:
KeyError: 'flags'
I was not doing anything in the terminal when this appeared. I had been on my browser and when I moved back to the terminal this was showing on the screen. This was about 1.5 hours after I had issue #919 occur and it was within the same zulip-terminal instance.
Running Zulip Terminal 0.6.0+git on mac in a Z shell
The text was updated successfully, but these errors were encountered: