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

fix: prevent infinite loop for readers and network errors on legacy data #187

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

pyphilia
Copy link
Contributor

@pyphilia pyphilia commented Dec 13, 2024

I noticed the legacy handling could be looping infinitely if the network call to patch app settings throws (because server is down or because user does not have the correct permission). The app-setting key would get invalidated and would trigger the patch again.

I mitigated the problem with a state that remembered a patch happened (server error for some reason) and only allowed admins to patch.

Readers trying to view an outdated quiz will see an error banner.

FOR LATER:
I think we can remove this legacy patch at some point (it has been a year now). But having the error today shows that some people actually returns to see old quiz.

@pyphilia pyphilia requested review from spaenleh and ReidyT December 13, 2024 13:29
@pyphilia pyphilia self-assigned this Dec 13, 2024
Copy link
Member

@spaenleh spaenleh left a comment

Choose a reason for hiding this comment

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

Nice ! No more involuntary DDOS.

@pyphilia pyphilia merged commit 717c14d into main Dec 16, 2024
5 checks passed
@pyphilia pyphilia deleted the patch-legacy branch December 16, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants