Skip to content

Shared worker: Release mutex when tab closes #98

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

Merged
merged 2 commits into from
Jun 3, 2025

Conversation

simolus3
Copy link
Contributor

@simolus3 simolus3 commented Jun 3, 2025

When a tab connected to the shared worker holds a mutex while being closed, it's possible for the mutex to still be held in the AsyncSqliteDatabase without ever being released.

This tracks which connections hold a mutex and registers a listener when they close to return the mutex. I've tested this manually with a small demo, it's hard to test this automatically since it relies on multiple tabs.

@simolus3 simolus3 requested a review from stevensJourney June 3, 2025 08:56
Copy link
Contributor

@stevensJourney stevensJourney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me :)

@simolus3 simolus3 merged commit c1b3c4e into main Jun 3, 2025
6 checks passed
@simolus3 simolus3 deleted the release-tab-lock-on-close branch June 3, 2025 09:28
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