8000 [FIX] Duplicate segment call by ga-devfront · Pull Request #1337 · PrestaShop/autoupgrade · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Merged
merged 2 commits into from
May 5, 2025

Conversation

ga-devfront
Copy link
Contributor
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

@ga-devfront ga-devfront added the bug Type: Bug fix label May 2, 2025
@github-project-automation github-project-automation bot moved this to Ready for review in PR Dashboard May 2, 2025
Copy link
sonarqubecloud bot commented May 2, 2025

Comment on lines +105 to +107
const analyticsInstance = new Analytics();

export default analyticsInstance;
Copy link
Member
@Quetzacoalt91 Quetzacoalt91 May 2, 2025

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 ?

Copy link
Contributor Author

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.

@AureRita AureRita self-assigned this May 5, 2025
Copy link
Contributor
@AureRita AureRita left a 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 d’écran du 2025-05-05 11-50-42

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

@ga-devfront ga-devfront merged commit a65224c into PrestaShop:dev May 5, 2025
38 checks passed
@github-project-automation github-project-automation bot moved this from Ready for review to Merged in PR Dashboard May 5, 2025
@ga-devfront ga-devfront deleted the fix/duplicate-segment-call branch May 5, 2025 14:17
@ps-jarvis
Copy link
Collaborator

PR merged, well done!

Message to @PrestaShop/committers: do not forget to milestone it before the merge.

@ga-devfront ga-devfront added this to the 7.1.0 milestone May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Bug fix QA ✔️
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants
0