Financial-Times / o-tracking

Origami Tracking component
http://registry.origami.ft.com/components/o-tracking
6 stars 8 forks source link

Fix bug where loading spoor-id from the cookie would silently fail #336

Closed JakeChampion closed 3 years ago

JakeChampion commented 3 years ago

spoor-id is stored directly as a string and not an json object, which meant json.parse would throw an error and we would not be migrating the old spoor-id value to localstorage and instead would mint a new spoor-id, which is not what we want to do.

origamiserviceuser commented 3 years ago

o-tracking bundle size difference from 3.0.3 to 5117614f778630b4bc377e17b1921b7799eb0a4e No bundle size differences found.

Lily2point0 commented 3 years ago

I clicked 'approve' by force of habit, I actually had a comment first but I don't know how to remove my approval 😅

notlee commented 3 years ago

Flying brain dump before leaving for lunch: If the cookie is not removed won't any data set to local storage be ignored on future visits? Maybe the content of the cookie should be emptied except ids and the check be based on that?

JakeChampion commented 3 years ago

Flying brain dump before leaving for lunch: If the cookie is not removed won't any data set to local storage be ignored on future visits? Maybe the content of the cookie should be emptied except ids and the check be based on that?

Good idea, I'll implement that 👍

Just for refence, I check o-tracking v2 and there are 3 stores being used:

origamiserviceuser commented 3 years ago

o-tracking bundle size difference from 3.0.3 to a5b74598a330c49b0f3f3f0f246b95c1b6ab1a59 No bundle size differences found.

origamiserviceuser commented 3 years ago

o-tracking bundle size difference from 3.0.3 to edf82b0a93e4c6ccd21ebfd193cb781e44534c13 No bundle size differences found.

origamiserviceuser commented 3 years ago

:tada: This PR is included in version v3.0.4 :tada: