-
Notifications
You must be signed in to change notification settings - Fork 124
[FIX] Duplicate segment call #1337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] Duplicate segment call #1337
Conversation
Questions | Answers |
---|---|
Description? | We currently have an issue with auto-tracking that triggers the event multiple times. This PR aims to fix this issue. |
Type? | bug fix |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | N/A |
Sponsor company | @PrestaShopCorp |
How to test? | See internal related ticket |
|
const analyticsInstance = new Analytics(); | ||
|
||
export default analyticsInstance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this change enough to prevent the duplicated events? No need of the new class variable #isAutoTrackSet
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, #isAutoTrackSet is only used if the same instance tries to re-set autotrack (a security feature that I added), however the problem comes from duplication, which comes from the fact that there were 2 instances. By creating the instance directly and sharing it, the problem disappears.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ga-devfront
Thank you for your PR, I tested it and it seems to works as you can see :
Capture.video.du.2025-05-05.11-43-15.mp4
Tested from :
1.7.8.9 to 8.2.1
Because the PR seems to works as expected, It's QA ✔️
Thank you
PR merged, well done! Message to @PrestaShop/committers: do not forget to milestone it before the merge. |