fix: handle ObjectBox intra-process double-open on Linux desktop#3021
Open
ManavA wants to merge 1 commit into
Open
fix: handle ObjectBox intra-process double-open on Linux desktop#3021ManavA wants to merge 1 commit into
ManavA wants to merge 1 commit into
Conversation
`_initDatabaseDesktop` only handled the cross-process case (Linux: signal-and-exit) and the Windows isolate case (attach). on Linux when an isolate or background entry point opens the store first, the main thread's `openStore()` throws "another store is still open using the same path" — which falls into the Linux branch and exits the app. restructure to check `Store.isOpen()` upfront (attach if so), and treat the "another store is still open" exception as the intra-process signal regardless of platform. Linux's exit-and-signal path now only runs for genuine cross-process collisions. mirrors what `_initDatabaseMobile` already does.
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.
Problem
`_initDatabaseDesktop` distinguishes between cross-process (Linux: signal the running instance and exit) and intra-process (Windows: `Store.attach`) collisions when `openStore()` fails. but on Linux, when an isolate or another entry point in the same process opens the store first, the main thread's `openStore()` raises:
```
another store is still open using the same path
```
…which currently falls into the `Platform.isLinux` branch and silently `exit(0)`s the app — even though there's no second process to signal. `_initDatabaseMobile` already handles this case correctly with `Store.isOpen()` + attach; desktop didn't.
Solution
Testing