Skip to content

fix(concurrency): resolve potential UI thread deadlocks by decoupling RwLock from Webview IPC calls #88

Description

@Diwakar-odds

Describe the bug
In �rowser.rs, the code obtains a synchronous RwLock write lock on the global state while simultaneously invoking Tauri IPC methods (w.hide(), w.show()). If the main UI thread attempts to read the state during the IPC call, it results in a classic thread deadlock, freezing the entire application.

To Reproduce
Trigger rapid tab switching while background tabs are aggressively loading.

Expected behavior
Global locks should never be held across cross-thread IPC boundaries.

Suggested Solution
Clone the necessary metadata out of the state, drop the RwLock manually, and then execute the Tauri Webview IPC calls outside the critical section.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions