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

Even disabled, vaadin-usage-statistics pollutes window.localStorage #71

Open
jimbojw opened this issue Apr 27, 2023 · 4 comments
Open

Comments

@jimbojw
Copy link

jimbojw commented Apr 27, 2023

Per the instructions on how to opt-out, the vaadin-usage-statistics.js file is indeed empty:

$ cat ./node_modules/@vaadin/vaadin-usage-statistics/vaadin-usage-statistics.js 
export const usageStatistics = function() {
  /* do nothing */
};

However, in the browser, the window.localStorage object continues to have usage statistics inserted. Running the following code in the console reveals the violation:

for (let i = 0; i < localStorage.length; i++) {
  console.log(i, localStorage.key(i));
}

Console output:

0 vaadin.statistics.firstuse
1 vaadin.statistics.basket
@jimbojw
Copy link
Author

jimbojw commented Apr 27, 2023

Note: I'm not using this project directly. It is a dependency of @vaadin/router.

@yuriy-fix
Copy link
Contributor

@Artur- , is it an expected behaviour?

@jimbojw
Copy link
Author

jimbojw commented May 7, 2023

If it is expected, do I need to make a separate issue to feature request a disable flag? Or could this issue stand-in for such a request?

@Artur-
Copy link
Member

Artur- commented May 9, 2023

I think this might be a problem with how router is distributed. It currently bundles its dependencies into one JS file, which means it is unable to pick up the optout version of vaadin-usage-statistics.js. If so, then vaadin/router#828 should solve this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants