Skip to content

fix: prevent autocomplete render event for cached responses, increate…#1460

Merged
korgon merged 3 commits into
developfrom
ac-cached-render-event
Mar 10, 2026
Merged

fix: prevent autocomplete render event for cached responses, increate…#1460
korgon merged 3 commits into
developfrom
ac-cached-render-event

Conversation

@dkonieczek

Copy link
Copy Markdown
Contributor

… click debounce time

@dkonieczek dkonieczek requested a review from korgon March 6, 2026 16:25
@dkonieczek dkonieczek marked this pull request as ready for review March 6, 2026 16:26
Copilot AI review requested due to automatic review settings March 6, 2026 16:26
This was linked to issues Mar 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 adjusts tracking and click-handling behavior by marking cache-hit API responses and using that marker to suppress duplicate autocomplete “render” beacon events, while also increasing the click-duplication debounce window.

Changes:

  • Increase CLICK_DUPLICATION_TIMEOUT to reduce duplicate click/clickThrough tracking within a short time window.
  • Mark cached API responses with an _cached flag in snap-client and propagate it through transformSearchResponse.
  • Skip firing the autocomplete “render” tracking event when the response is from cache.

Reviewed changes

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

File Description
packages/snap-controller/src/utils/isClickWithinProductLink.ts Increases click duplication timeout used by controllers to debounce clickthrough tracking.
packages/snap-controller/src/Autocomplete/AutocompleteController.ts Suppresses autocomplete render tracking for cached responses (currently via _cached + @ts-ignore).
packages/snap-client/src/Client/transforms/searchResponse.ts Extends transformed search response to include _cached boolean.
packages/snap-client/src/Client/apis/Abstract.ts Tags cache-hit responses with _cached before returning them.

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

Comment thread packages/snap-controller/src/Autocomplete/AutocompleteController.ts Outdated
Comment thread packages/snap-client/src/Client/apis/Abstract.ts Outdated
Comment thread packages/snap-client/src/Client/apis/Abstract.ts
Comment thread packages/snap-client/src/Client/transforms/searchResponse.ts
@korgon korgon merged commit bfccaf1 into develop Mar 10, 2026
1 check passed
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.

Increase clickThrough debounce Duplicating Render Events

3 participants