Skip to content

Don't error on empty topics#116

Open
tekknolagi wants to merge 1 commit intozulip:masterfrom
tekknolagi:master
Open

Don't error on empty topics#116
tekknolagi wants to merge 1 commit intozulip:masterfrom
tekknolagi:master

Conversation

@tekknolagi
Copy link
Copy Markdown
Contributor

@tekknolagi tekknolagi commented Dec 5, 2025

Fix #112

Comment thread lib/populate.py
latest_date = last_message["timestamp"]
if messages:
# Dump empty topics but don't try to get the latest message or
# date from them
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you explain the logic behind the approach here? Empty topics are the "general chat" feature.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By empty I mean "does not contain messages". Our chat has a general chat that seems to contain messages on the application but messages[-1] raises an exception. So I figured we would not update the dates from non-existent messages.

Are you expecting to see no messages in "general chat"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

populate.py: crash on empty message list

2 participants