analytics icon indicating copy to clipboard operation
analytics copied to clipboard

fix: crash in analytics.reset for aws pinpoint

Open renzil opened this issue 2 years ago • 0 comments

Title: Calling analytics.reset leads to a crash on analytics-plugin-aws-pinpoint in the browser Browser: Chrome Version 115.0.5790.114 (Official Build) (x86_64) OS: OSX 12.6.5

Steps to reproduce:

  1. Setup a vanilla HTML in browser implementation of analytics and analytics-plugin-aws-pinpoint
  2. Call analytics.reset

Result: Crash with the following stacktrace

storage is not defined ReferenceError: storage is not defined at Object.reset (https://my.bundle.min.js:2099:7) at https://my.bundle.min.js:2196:9319

Analysis: The storage object is not defined but is being used to delete a key in the reset callback of the pinpoint plugin. I have just directly used the removeItem import and I am getting results as expected. Please verify if this is the correct fix @DavidWells

renzil avatar Aug 14 '23 10:08 renzil