Conversation
Contributor
korgon
commented
Mar 6, 2026
- harden tracking events (prevent events from running when responseId not found in controller)
- update beacon.js package version
- update some documentation around beacon in tracker
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds defensive guard checks to tracking event methods across all three controller types (Search, Recommendation, Autocomplete) to prevent runtime errors when a responseId is not found in the controller's event tracking state. It also bumps the @athoscommerce/beacon dependency from 1.0.1 to 1.1.0 and updates documentation to point to the correct repository and uncomment previously-TODO sections.
Changes:
- Added
!this.events[responseId]guard checks in all tracking event methods (impression,click,clickThrough,addToCart) acrossSearchController,RecommendationController, andAutocompleteControllerto prevent events from firing when theresponseIdis not found. - Updated
@athoscommerce/beaconfrom1.0.1to1.1.0, which no longer depends on@searchspring/snap-toolbox. - Updated documentation in
README.mdanddocs/documents.jsto reference the correctathoscommerce/beacon.jsGitHub repository and uncomment event method documentation.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/snap-tracker/package.json |
Bumps @athoscommerce/beacon from 1.0.1 to 1.1.0 |
packages/snap-tracker/README.md |
Updates beacon.js links to athoscommerce org and uncomments events documentation |
packages/snap-controller/src/Search/SearchController.ts |
Adds responseId guard checks to all 7 tracking event methods |
packages/snap-controller/src/Recommendation/RecommendationController.ts |
Adds responseId guard checks to all 4 tracking event methods |
packages/snap-controller/src/Autocomplete/AutocompleteController.ts |
Adds responseId guard checks to all 7 tracking event methods |
package-lock.json |
Reflects beacon version bump and removed @searchspring/snap-toolbox transitive dependency |
docs/documents.js |
Removes commented-out TODO links for beacon.js docs |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dkonieczek
approved these changes
Mar 6, 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.