zulip-terminal
zulip-terminal copied to clipboard
Fix ZT crash with an Index Error.
What does this PR do, and why?
This PR fixes the Index Error mentioned in #1226. The PR resolves this by setting the focus pointer to the message index instead of the message ID. Other functions depending on the focus pointer also treat it as the message index, so the change in this PR keeps its usage consistent.
Outstanding aspect(s)
- [ ]
External discussion & connections
- [x] Discussed in #zulip-terminal in
IndexError while starting.
- [x] Fully fixes #1226
- [ ] Partially fixes issue #
- [ ] Builds upon previous unmerged work in PR #
- [ ] Is a follow-up to work in PR #
- [ ] Requires merge of PR #
- [ ] Merge will enable work on #
How did you test this?
- [x] Manually - Behavioral changes
- [ ] Manually - Visual changes
- [x] Adapting existing automated tests
- [ ] Adding automated tests for new behavior (or missing tests)
- [ ] Existing automated tests should already cover this (only a refactor of tested code)
Self-review checklist for each commit
- [x] It is a minimal coherent idea
- [x] It has a commit summary following the documented style (title & body)
- [x] It has a commit summary describing the motivation and reasoning for the change
- [x] It individually passes linting and tests
- [ ] It contains test additions for any new behavior
- [x] It flows clearly from a previous branch commit, and/or prepares for the next commit
@theViz343 Just noting here as I mentioned in the stream, that this may fix the bug, but it would be more consistent to approach this the other way around to avoid the UI index being stored in the model.