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

LocalStorage _mpq_ flush queue accumulate events #384

Open
JonLev opened this issue Jul 25, 2023 · 10 comments
Open

LocalStorage _mpq_ flush queue accumulate events #384

JonLev opened this issue Jul 25, 2023 · 10 comments

Comments

@JonLev
Copy link

JonLev commented Jul 25, 2023

Hi guys, I noticed a strange behaviour with Mixpanel events localStorage usage: I have some of my user that have in their local storage a key that just accumulate elements of tracking:
mixpanel-flush-queue-blurred

From my investigation this element is a kind of batch accumulation to flush to mixpanel with some debounce. But for some reason I don't know yet, they accumulate within the storage instead. My deeper problem is that other services that are based on storage are failing because there's so much elements that the storage limit is reached 😅.

My config is:

  • version 2.47.0
  • on Vue3

Let me know if you need more information

@tdumitrescu
Copy link
Member

Hi @JonLev, yes, it would be very useful to get more info on your specific setup and the monitoring you have on users who hit this condition (it's likely specific to some combo of browser version, extensions, os etc). Can you email me at ted@mixpanel.com? Thanks

@JonLev
Copy link
Author

JonLev commented Jul 26, 2023

Just did ! 🙏🏽

@hrvbernardic
Copy link

I've got the same problem. Would love to know if you find out why this is happening.

@tomlagier
Copy link

tomlagier commented Feb 20, 2024

Same problem here. Will write some code to flush those localstorage keys during app start, but would be nice to not have to do that.

Current guess is that ublock is blocking the request that would flush the queue, which causes events to accumulate.

EDIT: Upgrading from mixpanel-browser 2.41 to 2.49 seems to have fixed the issue.

@hussain-s6
Copy link

Happening to us as well. My guess is that adblockers are preventing mixpanel events so they never get sent (or flushed). We will update to 2.49 and hope that fixes it

@Colombo97
Copy link

Colombo97 commented May 8, 2024

@hussain-s6 did you solve it? I couldn't

@goamn
Copy link

goamn commented May 14, 2024

@hussain-s6 did you solve it? I couldn't

No idea. It happened to my colleague and I was hoping it would fix the issue. I will try and check with him to see if it's still there. I didn't find any difficulty in upgrading to the newer version, did you try it? It's quite easy to diagnose, you can look for "mpq" items and see if they are getting big or not (100-500kb or greater), just run this script below, it is sorting in ascending order:

var _lsTotal=0,_xLen,_x,_lsData=[];for(_x in localStorage){if(localStorage.hasOwnProperty(_x)){_xLen=((localStorage[_x].length+_x.length)*2);_lsTotal+=_xLen;_lsData.push({key:_x,size:_xLen});}}_lsData.sort((a,b)=>a.size-b.size).forEach(item=>console.log(item.key.substr(0,50)+" = "+(item.size/1024).toFixed(2)+" KB"));console.log("Total = "+(_lsTotal/1024).toFixed(2)+" KB");

@Colombo97
Copy link

Yes I tried to update but it didn't solve. About the script, yes, I've added one to check the storage size, almost the same that you've shared.

@Colombo97
Copy link

I'm thinking about making a workaround to solve this deleting the mpq from the localstorage

@goamn
Copy link

goamn commented May 14, 2024

I'm thinking about making a workaround to solve this deleting the mpq from the localstorage

I think it's valid to use a workaround, otherwise users will have a crashed app with no way to recover. Thanks for letting me know, we will probably implement the workaroudn as well :)

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

7 participants