Skip to content
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

Old polls cause web exceptions and broken appearance #30148

Open
gnprice opened this issue May 20, 2024 · 7 comments
Open

Old polls cause web exceptions and broken appearance #30148

gnprice opened this issue May 20, 2024 · 7 comments
Labels
area: api area: widgets Poll and similar widgets bug

Comments

@gnprice
Copy link
Member

gnprice commented May 20, 2024

To reproduce

  • Open the web app at chat.zulip.org.
  • Open the JS console.
  • Visit an old message (pre-2019) with a poll, like here.

Expected

No exceptions in the console.

The poll either appears accurately, or shows a clear error message saying it can't be shown.

Actual

The poll will appear but with no options or votes:
image

The JS console will show a burst of exceptions:

Failed to do_process_submessages
3 poll widget: unknown inbound type: new_comment
unknown key for poll: 815,1
unknown key for poll: 815,2
unknown key for poll: 815,1
[… and more …]

From those exceptions, I'm pretty sure the poll indeed had some options in it and some votes.

Discussion

It looks like these are from before Zulip Server 2.0, where we released the polls feature:
https://zulip.readthedocs.io/en/latest/overview/changelog.html#zulip-server-2-0-0

And in particular that new_comment name apparently was used before 2019-01, when it was renamed to new_option in c176891 .

So what's happening is that we had an experimental API, sent messages on chat.zulip.org that used it, and they're now in the history but not handled by the current code.

It's probably fine to not support the old experimental API. Probably nobody outside chat.zulip.org was using it (at least I hope not); and I don't know how much we really used it outside tests, but even where we did, it's unlikely we care too much about those polls 5+ years later.

But if we don't have support for accurately rendering the message, we should tell the user that — we shouldn't just show something misleading.

(I noticed this because zulip-mobile has the same behavior, because it's using shared code. I'll make a note on the polls issue for zulip-flutter that we should reject polls that have this old experimental API.)

@zulipbot
Copy link
Member

Hello @zulip/server-api members, this issue was labeled with the "area: api" label, so you may want to check it out!

@Mukul1235
Copy link
Collaborator

Hi @gnprice
Can you please guide me how I can replicate this issue in my local? Also this seems to be like a data issue. I means ideally those polls data should be there in Django-models.

@Mukul1235
Copy link
Collaborator

@zulipbot claim!

@zulipbot
Copy link
Member

Hello @Mukul1235!

Thanks for your interest in Zulip! You have attempted to claim an issue without the label "help wanted". You can only claim and submit pull requests for issues with the help wanted label.

If this is your first time here, we recommend reading our guide for new contributors before getting started.

@timabbott
Copy link
Sponsor Member

@N-Shar-ma can you fix this one?

@N-Shar-ma
Copy link
Collaborator

@gnprice Thank you for the detailed issue report! I've started a thread at https://chat.zulip.org/#narrow/stream/101-design/topic/Old.20polls.20cause.20web.20exceptions.20and.20broken.20appearance to discuss how to deal with these old broken polls.

PS: Interestingly, new votes and options do work, they just need a reload

@timabbott
Copy link
Sponsor Member

I believe this was fixed through surgery on the chat.zulip.org database, but we should leave this open until we've decided what to do with the old tictactoe widgets generating similar exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api area: widgets Poll and similar widgets bug
Projects
None yet
Development

No branches or pull requests

5 participants