amplitude/Amplitude-TypeScript

Was there an issue with AMP_unset, or was there an issue with Identify.set being over-called?

leeyun1533 opened this issue · 3 comments

Summary

In the following version, the error Amplitude Logger [Error]: Failed to save events bease the queue length exceeded 1000' appears
I experienced an error that shut down the web. When I looked up a little more, it seemed like an error that Amplitude was unable to handle too many events after accumulating a lot of events in the AMP_unset-something part of the localStorage, was there an issue with the specific version?

It doesn't happen when you downgrade to @amplitude/analytics-client-common@npm:^2.1.0, and it's good for the latest version.

The code I used is simple. I think there is an error in identify.
This error caused a fatal error on our web, so it would be good if you could quickly inform us of the related issue

The only PR I've found is the modifications below, but I don't know if this is what caused it
#689

  const indentifyObj = new Identify();
  const sampledTarget = user.sample; 

  indentifyObj.set('sampledTarget', sampledTarget);
  indentifyObj.set('sampleRate', AMPLITUDE_SAMPLE_RATE.toString());

ref version

@amplitude/analytics-client-common@npm:^2.1.1":
  version: 2.1.1

"@amplitude/analytics-core@npm:^2.1.0, @amplitude/analytics-core@npm:^2.2.2":
  version: 2.2.2
  resolution: "@amplitude/analytics-core@npm:2.2.2"

@leeyun1533 - there was a bug in version 2.5.3 which was introduced by the PR you referenced. It was reverted and 2.6.0 was published. Can you please check if you're running into the issue with 2.6.0 as well?

Thank you. It seems to have been fixed in the latest version. Could you give me a link to Revert PR?

More than 4 million users use it in our service, and the issue of excessive memory has had a bad effect on the user experience.

I think it's a critical issue and I'm trying to get a closer look at it.

@izaaz

@leeyun1533

Here's the PR that reverts the issue: #687

And here's the PR for fix forward: #689

The issue specifically happens when the server returns a bad request (for example the user id length was less than 5 characters or for other reasons). There was a bug in how we handled 4xx result codes. The fix forward is currently in a beta version of the SDK and is currently deployed in Amplitude's website to test it out. We will soon be releasing v2.6.3 with the fix.