Repository navigation
feat(webhost): delete buttons for rooms, lobbies and seeds on /me - #184
Merged
Merged
Conversation
- WebHostLib/models.py: add the UNOWNED (UUID(int=0)) sentinel; Base.get returns None for rows owned by it, so marked rows 404. - WebHostLib/ownership.py: add release(): a co-owner drops its row, a primary owner revokes pending invites and hands off to the oldest co-owner or marks the record UNOWNED. - WebHostLib/api/user.py: add DELETE /api/me/rooms|lobbies|seeds/<id>; removing a joined room only forgets the visit. - WebHostLib/api/lobby.py: extract close_lobby() from lobby_close so a deleted lobby is closed the same way. - WebHostLib/autolauncher.py: cleanup() also deletes unowned lobbies. - WebHostLib/dashboard.py: joined rooms list skips rooms marked for deletion. - WebHostLib/templates/me_rooms.html, me_lobbies.html, me_seeds.html, macros.html: secondary card bar with a me_remove_button macro. - WebHostLib/static/assets/meRemove.js: confirm, send DELETE, drop the card. - WebHostLib/static/styles/me.css: card bar is now a container; styles for the delete button. - test/webhost/test_dashboard.py: cover handoff, co-owner and joined removal, 403s, lobby close, seed marking and 404s. - test/webhost/test_cleanup.py: cover cleanup of unowned lobbies.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Scope
Delete buttons on the /me Rooms, Lobbies and Seeds lists, using upstream's mark-for-deletion convention (owner set to
UUID(int=0), purged byautolauncher.cleanup()).Description
DELETE /api/me/{rooms,lobbies,seeds}/<id>.UNOWNED; a lobby is also closed. Removing a joined room only forgets the visit.cleanup(), which now deletes unowned lobbies as well as unowned rooms and seeds.Base.getreturns None for them, so every page and API that 404s on a missing row also 404s on a marked one. Rooms already created from a marked seed keep working.