Skip to content

feat(webhost): delete buttons for rooms, lobbies and seeds on /me - #184

Merged
lallaria merged 1 commit into
mainfrom
didi/webhost-delete-buttons-0d8a58
Oct 17, 2026
Merged

lallaria merged 1 commit into
mainfrom
didi/webhost-delete-buttons-0d8a58

Conversation

@lallaria

Copy link
Copy Markdown
Contributor

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 by autolauncher.cleanup()).

Description

  • Each list card gets a Delete button (Remove for joined rooms) that sends a confirmed DELETE /api/me/{rooms,lobbies,seeds}/<id>.
  • A co-owner who deletes only drops their own access. A primary owner revokes their pending invites and hands the record to the longest-standing co-owner. With no co-owner left, the record is marked UNOWNED; a lobby is also closed. Removing a joined room only forgets the visit.
  • Marked rows stay in the DB until the next cleanup(), which now deletes unowned lobbies as well as unowned rooms and seeds. Base.get returns 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.

- 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.
@lallaria
lallaria merged commit e37baf1 into main Oct 17, 2026
16 checks passed
@lallaria
lallaria deleted the didi/webhost-delete-buttons-0d8a58 branch October 17, 2026 02:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant