Skip to content
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

Make sure to always set JSON_PIWIK to native JSON when possible #15785

Merged
merged 2 commits into from Apr 7, 2020

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Apr 7, 2020

Even if JSON_PIWIK is an object, when possible assign the native JSON method again. This way it doesn't go into the else should JSON_PIWIK already be defined because the file was already loaded. Eg if you otherwise load JS tracker twice, the first time it would assign JSON_PIWIK = window.JSON, the second time it would go into the else where it then assigns JSON manually. Seeing this on a site that I'm debugging and it appears as then JSON_PIWIK might be ending up somehow with the value {}.

This seems to be because that site has a method amd from jquery

image

It is not using the loader logic
image

and it seems there the JSON/JSON3 value never gets assigned to exports:
image

Maybe because of some incompatible amd or something I'm not sure how this is supposed to work. Anyway, as we're removing this in Matomo 4 anyway I don't want to spend too much time on it and rather fix this issue in that case by assigning window.JSON whenever possible so it doesn't even run into that code.

@tsteur tsteur added the Needs Review PRs that need a code review label Apr 7, 2020
@tsteur tsteur added this to the 3.13.5 milestone Apr 7, 2020
@tsteur
Copy link
Member Author

tsteur commented Apr 7, 2020

build js

@sgiehl sgiehl merged commit fdb685c into 3.x-dev Apr 7, 2020
@sgiehl sgiehl deleted the jsonpiwik branch April 7, 2020 06:34
diosmosis added a commit that referenced this pull request Apr 16, 2020
* Avoid possible error subtable already exists but not loaded (#15779)

* Make sure to always set JSON_PIWIK to native JSON when possible (#15785)

* make sure to always set JSON_PIWIK to native JSON when possible

* rebuilt piwik.js

* Force POST for bulk requests, fix alwaysUseSendBeacon not respected for bulk requests (#15784)

* Force POST for bulk requests, fix alwaysUseSendBeacon not respected for bulk requests

* rebuilt piwik.js

* Make sure to clean up tracking failures before sending email notification (#15798)

Feedback from a customer... Eg the daily `cleanupTrackingFailures()` action might be only executed after the weekly `notifyTrackingFailures` therefore we should try to clean up failures first and then check if any are left. Avoids the case where a user opens hours later the email they receive and then there are no tracking failures reported. This could still happen but it's a bit less likely.

* 3.13.5-b1

* Faster segmented suggested values when browser archiving is disabled (#15786)

* Faster segmented suggested values when browser archiving is disabled

* make sure no segment is set

* remove wrong var type

* fix/add tests

* add more segment values

* detect if we should flatten or not

* add docs

* Fix problem when comparing segments or opening popovers (#15809)

refs #15805

* purge all old archives regardless of done value (#15800)

* purge all old archives regardless of done value, we only care about the newest usable one

* Fix test and start on new one.

* Add coverage for change in tests.

* there is no longer an inner join so should not need the idsite check

* Add more parameters to the computeNbUnique event (#15808)

* 3.13.5-b2

* One click update in two parts so new code is loaded for second. (#15770)

* One click update in two parts so new code is loaded for second.

* remove no longer needed code

Co-authored-by: Thomas Steur <tsteur@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Co-authored-by: Stefan Giehl <stefan@matomo.org>
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
…mo-org#15785)

* make sure to always set JSON_PIWIK to native JSON when possible

* rebuilt piwik.js
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
…mo-org#15785)

* make sure to always set JSON_PIWIK to native JSON when possible

* rebuilt piwik.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants