Skip to content

Move database room deletions to be consistent with saves#771

Merged
Et0h merged 1 commit into
Syncplay:masterfrom
gavtroy:delete-room-race
May 9, 2026
Merged

Move database room deletions to be consistent with saves#771
Et0h merged 1 commit into
Syncplay:masterfrom
gavtroy:delete-room-race

Conversation

@gavtroy
Copy link
Copy Markdown
Contributor

@gavtroy gavtroy commented Apr 21, 2026

Currently emptying a room with an empty playlist fires off two transactions which get run together:

  • update the room db entry (with nothing useful)
  • delete the room db entry

Usually the DELETE is processed first and then INSERT OR REPLACE adds the room back to the database. Although the room is gone from the GUI, it will pop back into existence when the server is restarted.

This change simplifies the logic to always delete the room from the database when the playlist is empty (regardless of whether there are watchers).

Currently emptying a room with an empty playlist fires off two
transactions which get run together:
- update the room db entry (with nothing useful)
- delete the room db entry

Usually the DELETE is processed first and then INSERT OR REPLACE adds
the room back to the database. Although the room is gone from the GUI,
it will pop back into existence when the server is restarted.

This change simplifies the logic to always delete the room from the
database when the playlist is empty (regardless of whether there are
watchers).
@Et0h
Copy link
Copy Markdown
Contributor

Et0h commented Apr 22, 2026

Nice catch!

@Et0h
Copy link
Copy Markdown
Contributor

Et0h commented Apr 22, 2026

Is this compatible with #754 which adds playback speed support?

@gavtroy
Copy link
Copy Markdown
Contributor Author

gavtroy commented Apr 22, 2026

Yes it applies and works fine. That PR doesn't bother storing the room speed in the database, but even if that gets added it shouldn't be an issue.

@Et0h
Copy link
Copy Markdown
Contributor

Et0h commented May 9, 2026

@gavtroy Great, I've tested it and it seems fine so I'll be accepting the PR. Thanks for your work on this!

@Et0h Et0h merged commit 9ea4a38 into Syncplay:master May 9, 2026
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.

2 participants