Skip to content

fix(controller/autocomplete): preventing additional render events fro…#232

Open
korgon wants to merge 2 commits intodevelopfrom
ac-repeated-search
Open

fix(controller/autocomplete): preventing additional render events fro…#232
korgon wants to merge 2 commits intodevelopfrom
ac-repeated-search

Conversation

@korgon
Copy link
Contributor

@korgon korgon commented Mar 10, 2026

  • preventing sending render events on repeated searches in autocomplete
  • extending click debounce to 1000ms

Copilot AI review requested due to automatic review settings March 10, 2026 19:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces duplicate tracking events by suppressing autocomplete render events on repeated/cached searches and increasing the click de-duplication debounce window to 1000ms.

Changes:

  • Skip sending autocomplete.render beacon events when the search is detected as repeated (same responseId).
  • Increase click de-duplication timeout from 300ms to 1000ms.
  • Add a Cypress E2E test intended to ensure repeated searches don’t emit extra autocomplete render/impression events.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.

File Description
packages/snap-preact-demo/tests/cypress/e2e/tracking/track.cy.js Adds a new Cypress test for repeated-search tracking behavior (currently has a logic issue).
packages/snap-controller/src/utils/isClickWithinProductLink.ts Updates the shared click de-duplication timeout constant to 1000ms.
packages/snap-controller/src/Autocomplete/AutocompleteController.ts Detects repeated searches by responseId and suppresses render tracking for repeats.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@korgon korgon requested a review from dkonieczek March 11, 2026 12:48
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