zulip/zulip-terminal

IndexError on starting (focus index vs message id)

开放

#1,226 创建于 2022年5月16日

 (8 条评论) (0 个反应) (0 位负责人)Python (352 个派生)github user discovery
bug: crashfurther discussion requiredhelp wanted

仓库指标

星标
 (855 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

This was discussed in #zulip-terminal > IndexError while starting., and has been reported by:

  • Aryan Shridhar
  • @Dishti-Oberai
  • @rht

This appears to be distinct from #326.

ZT is reported to crash before the UI loads.

The traceback ends with

IndexError: focus index is out of range: 1330877

(where the last number varies)

The bug currently occurs due to views.py line 119, on the assumption that:

  • the model provides a current focused message id
  • the focused message is set to the id
  • the initializer for MessageView sets the listbox focus to that id...
  • ...which is likely out of range, given ~30 messages in list, and message ids potentially being huge!

A temporary workaround is to remove that statement, but a fuller solution should likely consider how we handle/retain focus between narrows.

贡献者指南