Skip to content

Cleanup Active server if ID is not in database#6265

Draft
TimoPtr wants to merge 1 commit intomainfrom
feature/defensive_cleanup_active_server
Draft

Cleanup Active server if ID is not in database#6265
TimoPtr wants to merge 1 commit intomainfrom
feature/defensive_cleanup_active_server

Conversation

@TimoPtr
Copy link
Member

@TimoPtr TimoPtr commented Jan 16, 2026

Summary

I'm trying to understand in which scenario we are giving an ID that doesn't exist anymore, while investigating this I had this idea that maybe we storing in the local storage the active server ID that doesn't exist anymore. I'm not sure if it possible but in case we could take this defensive approach to clear the local preference if the ID does not exist to unlock the situation on the next run.

Checklist

  • New or updated tests have been added to cover the changes following the testing guidelines.
  • The code follows the project's code style and best_practices.
  • The changes have been thoroughly tested, and edge cases have been considered.
  • Changes are backward compatible whenever feasible. Any breaking changes are documented in the changelog for users and/or in the code for developers depending on the relevance.

Any other notes

I'm looking for other places, but the crashes that I see on sentry might also be because of old data that we didn't cleanup and that we are never cleaning.

@jpelgrom
Copy link
Member

I had this idea that maybe we storing in the local storage the active server ID that doesn't exist anymore

It shouldn't be, whenever the server is deleted the same check you're adding here is applied to remove it:

if (localStorage.getInt(PREF_ACTIVE_SERVER) == id) localStorage.remove(PREF_ACTIVE_SERVER)

If you can point to an issue where it indicates there is an old server ID stored as active I'm OK with this change, but otherwise I would like to not include it so we know if things go wrong.

@jpelgrom
Copy link
Member

Some additional discussion on Discord for future reference

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants