Skip to content

bug(platform): Website content search can replace newer results with an older response #3832

Closed

Description

@yannickmonney

Bug: Website content search can replace newer results with an older response

  • Classification: confirmed candidate defect, P2 (stale results can mislead content inspection).
  • Source SHA: 9ea59724df24d62729a9360f3902d964dab39b3e.
  • Evidence: products-websites-next-search-race-evidence.md; an isolated Vitest/jsdom harness passed an out-of-order completion test against the current WebsiteViewDialog.

Reproduction

  1. Open WebsiteViewDialog for a crawled site and submit a content search for first.
  2. Immediately replace the field with second and press Enter again.
  3. Resolve the second action first with a “Second result”, then resolve the earlier first action with a “First result”.

The input still displays second, but the dialog displays “First result” and the newer result is gone. The harness controlled only the backend action boundary and passed the stale-state assertion; no production request was made.

Root cause

services/platform/app/features/websites/components/website-view-dialog.tsx:337-345 installs one onSuccess callback that unconditionally calls setSearchResults(data.results) and clears isSearching. triggerSearch at :354-362 allows another Enter while the first action is pending, and the SearchInput stays enabled. There is no request token or query identity check, so late responses can overwrite the latest query.

Expected / actual

Expected: only the latest submitted query may update the result list, or the input should prevent overlapping searches while still guarding late responses. Actual: network timing can show content for an older query under the newer visible input, undermining inspection accuracy.

Deduplication

No matching current ledger or issue title covers Website content-search races; existing website findings concern scan/status/page-data paths.

Suggested repair

Track a monotonically increasing request token or compare the returned query with the active query before applying results, and add a regression that resolves two searches out of order.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions