Prevent stale path selection while directory contents are loading - #5830
Open
GlazerMann wants to merge 2 commits into
Open
GlazerMann wants to merge 2 commits into
GlazerMann wants to merge 2 commits into
Conversation
GlazerMann
marked this pull request as draft
September 22, 2026 20:21
GlazerMann
marked this pull request as ready for review
September 22, 2026 20:23
Contributor
Author
|
The jobs failures are the problem fixed by #5815. Doing GUI testing with CI is really hard. |
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.
Summary
A BatchConnect path-selector system test exposed a pre-existing race in directory navigation.
When a user clicks a directory,
PathSelectorTable#reloadTablestarts an asynchronousfetch(). The selected/last-visited path is not updated until that request completes, but the Select Path button remains usable while the request is pending. A fast click on Select Path can therefore submit the previously loaded directory instead of the directory the user just selected.This is a production UI race, not just a Selenium timing issue: the footer remains interactive while directory navigation is pending. The flaky
path_selector can hide files, only showing directoriessystem test exposed that same window by clicking the directory and footer button back-to-back.Changes
path_selector worksand preserve its existing assertion that the loading spinner is hidden after the reload completes.Behavior and error handling
File selection remains unchanged because file clicks update the selected path synchronously and do not reload the table.
The existing error-display behavior is also preserved.
resetTable()remains in the existing success/error paths rather than being moved intofinally, so an error can still show#forbidden-warningwithout it immediately being hidden. After the newest reload succeeds or fails, Select Path is enabled again; stale responses do not alter the current table, warning state, or selected path.In-flight requests are not aborted; older requests are allowed to complete, but their responses are ignored once a newer reload has started.
The implementation intentionally uses a single request-generation counter rather than maintaining a second loading-state flag. The button's native
disabledstate is the UI lock, avoiding duplicate state that could drift out of sync.Why this is separate from #5829
This race was found while investigating a failed system-test job associated with #5829, but it is independent of the ChromeDriver detached-document workaround. This change does not broaden Selenium retries or alter Capybara error handling; it fixes the path selector's asynchronous UI state directly.