mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
fix: resolve getFileHandle concurrent stalling by queuing callbacks (#50597) Previously, concurrent calls to FileSystemAccessPermissionContext::ConfirmSensitiveEntryAccess for the same file path would silently discard the subsequent callbacks because the internal callback map used a single callback per file path and std::map::try_emplace would drop the callback if the key already existed. This caused Promises in JS (e.g., dirHandle.getFileHandle()) to stall indefinitely. This commit updates the callback map to hold a vector of callbacks, so all concurrent requesters for the same filepath are grouped together and resolved once the asynchronous blocklist check completes. Notes: Fixed an issue where concurrent `getFileHandle` requests on the same path could stall indefinitely. Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com> Co-authored-by: Kunal Dubey <21157775+xakep8@users.noreply.github.com>