Skip to content

fix: recover when stale preload response resolves after search starts - #1063

Open
bytestream wants to merge 1 commit into
orchidjs:masterfrom
bytestream:virtual-scroll-options-wiped
Open

fix: recover when stale preload response resolves after search starts#1063
bytestream wants to merge 1 commit into
orchidjs:masterfrom
bytestream:virtual-scroll-options-wiped

Conversation

@bytestream

Copy link
Copy Markdown
Contributor

When preload: 'focus' is enabled, focusing the dropdown triggers a preload request for the empty query. If the user immediately types a search before the preload responds, a race condition can occur:

  1. Focus fires load('') request (preload)
  2. User types, fires load('search') request
  3. Preload response arrives after the search response
  4. The snapshot latch (default_values_loaded) marks itself true despite capturing zero data
  5. Clearing the search or closing the dropdown runs restoreDefaults()addOptions([]) → options wiped permanently
  6. preloaded class prevents re-fetch, dropdown stays empty

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant