Skip to content

Combo box: prevent races between async suggestions and options rewrite#6483

Open
aerosol wants to merge 6 commits into
masterfrom
flaky-combobox-test
Open

Combo box: prevent races between async suggestions and options rewrite#6483
aerosol wants to merge 6 commits into
masterfrom
flaky-combobox-test

Conversation

@aerosol

@aerosol aerosol commented Jul 5, 2026

Copy link
Copy Markdown
Member

This PR addresses flaky combobox test mostly appearing in CI env.

The problem was essentially two async suggest_fun were executed - on connect and on search. In tests, both sleep 500ms - which means they finish nearly simultaneously giving no guarantees about send_update message handling order. This change makes sure if search is in progress or made, the initial prefetch suggestions update will be ignored.

Because we still have to support cases like messaging existing comboboxes to update their options (funnel step suggestions are shrinked via a broadcast, once one is picked) recognizing async function execution result is necessary.

To repro, revert the actual fix and run mix test test/plausible_web/live/components/combo_box_test.exs --include slow --seed 1 - should exceed 60s timeout.

@aerosol aerosol changed the title Flaky combobox test Combo box: prevent races between async suggestions and initial options Jul 5, 2026
@aerosol aerosol changed the title Combo box: prevent races between async suggestions and initial options Combo box: prevent races between async suggestions and options rewrite Jul 5, 2026
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.

2 participants