windows: Panic if 2 Windows users try to have the same app running at the same time
ReactorScram opened this issue · 0 comments
ReactorScram commented
Saw this over on the Firezone client: firezone/firezone#2808
The 2nd app instance panics here:
tauri-plugin-deep-link/src/windows.rs
Line 59 in 0c28b75
I'm guessing what happens is, when prepare
tries to connect to the listening socket owned by the other Windows user, it fails, so it believes the 2nd instance is actually the 1st instance.
But then when register
tries to open the socket and listen for itself, it fails because they're in the same namespace.
I thought of a few possible patches, but it's not critical for our project so I haven't started on any:
- Move the bind out of the worker thread and change the
expect
into returning an error before the worker thread is started. This means you can't run the app in 2 Windows sessions at once, but at least it won't panic in the worker thread - Add the user's ID into the socket's ID so that you can have 2 separate sockets, but only one per user.