fix: prevent autocomplete render event for cached responses, increate…#1460
Merged
Conversation
… click debounce time
This was
linked to
issues
Mar 6, 2026
Contributor
There was a problem hiding this comment.
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_TIMEOUTto reduce duplicate click/clickThrough tracking within a short time window. - Mark cached API responses with an
_cachedflag in snap-client and propagate it throughtransformSearchResponse. - 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.
…nditionally send render event
korgon
approved these changes
Mar 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
… click debounce time