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

Return a dedicated error page on invalid election data #152

Open
Oaphi opened this issue Nov 27, 2021 · 2 comments
Open

Return a dedicated error page on invalid election data #152

Oaphi opened this issue Nov 27, 2021 · 2 comments
Assignees
Labels
dashboard Bot dashboard-related issues/PRs improvement

Comments

@Oaphi
Copy link
Collaborator

Oaphi commented Nov 27, 2021

Currently, if the election data ends up invalid, depending on the occurrence of the check, the server is either not started up at all (if the failure happens early or crashes with a 500 on subsequent connects if the rescraper lead to an invalid election state. Latest to date downtime of the bot resulted from Stack Exchange breaking access to nomination pages - we want to avoid crashing if that happens as we can still serve some useful info in the meantime and periodically rescrape to ensure we are up and running as soon as the issue is fixed.

Already working on, documenting to keep track of the updates.

There are two sub-issues that need to be solved as part of this issue:

  1. The server is started way after Election#validate method is called, and the latter exits early
  2. The ScheduledAnnouncement#rescrape method ends up breaking the bot if the election state is invalid
@Oaphi Oaphi self-assigned this Nov 27, 2021
@Oaphi
Copy link
Collaborator Author

Oaphi commented Apr 18, 2022

Sub-issue 1: the server is now started much earlier, but still insufficiently early to be independent of election scraping:

const dashboardApp = await startServer(client, room, config, election);

@Oaphi
Copy link
Collaborator Author

Oaphi commented Apr 18, 2022

Sub-issue 2: should be fixed as election state can no longer break the bot due to internal try..catch blocks:

const { status, errors } = election.validate();

@Oaphi Oaphi added the dashboard Bot dashboard-related issues/PRs label Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dashboard Bot dashboard-related issues/PRs improvement
Projects
None yet
Development

No branches or pull requests

1 participant