analytics_flutter icon indicating copy to clipboard operation
analytics_flutter copied to clipboard

Error loading storage: FormatException due to corrupted serialized state

Open felixwoestmann opened this issue 9 months ago • 8 comments

Hello, we ran into the issue that the serialized state is broken and can't be deserialized. When initializing the Client we are now catching the error, but would like to have an option to delete all stored state to remove the error. Currently it occurs every time when starting the application.

Is there a way to do so?

The following is the data which is not valid Json and therefore couldn't be deserialized. It was from the file analytics-flutter-queue_flushing_plugin.json.

{"queue":[{"anonymousId":"cfe0edd5-2348-47f0-a1e4-6a3ecedf07b9","messageId":"0d9de8ea-c709-4e96-aea4-b66bc51db74a","userId":null,"timestamp":"2024-04-30T13:22:09.965928","context":{"app":{"build":"1","name":"App Name","namespace":"com.app.name","version":"3.40.0"},"device":{"manufacturer":"Google","model":"sdk_gphone64_arm64","name":"emu64a","type":"android"},"library":{"name":"analytics-flutter","version":"1.0.0"},"locale":"en-US","network":{"cellular":false,"wifi":true},"os":{"name":"Android","version":"14"},"screen":{"height":1270,"width":720,"density":2.0},"timezone":"Europe/Ljubljana","instanceId":"5e8546bb-bba3-4ff7-b3b1-f5ab3d42d7a6","traits":{}},"integrations":null,"_metadata":{"bundled":[],"unbundled":["Actions Amplitude"],"bundledIds":[]},"event":"responseReceived","properties":{"screen":"LoginRoute","value":"Success"},"type":"track"},{"anonymousId":"cfe0edd5-2348-47f0-a1e4-6a3ecedf07b9","messageId":"bf9ead8c-29df-4fd2-9b02-71dee4ba5e55","userId":null,"timestamp":"2024-04-30T13:22:09.983209","context":{"app":{"build":"1","name":"App Name","namespace":"com.app.name","version":"3.40.0"},"device":{"manufacturer":"Google","model":"sdk_gphone64_arm64","name":"emu64a","type":"android"},"library":{"name":"analytics-flutter","version":"1.0.0"},"locale":"en-US","network":{"cellular":false,"wifi":true},"os":{"name":"Android","version":"14"},"screen":{"height":1270,"width":720,"density":2.0},"timezone":"Europe/Ljubljana","instanceId":"5e8546bb-bba3-4ff7-b3b1-f5ab3d42d7a6","traits":{}},"integrations":null,"_metadata":{"bundled":[],"unbundled":["Actions Amplitude"],"bundledIds":[]},"name":"/select-hub","properties":{},"type":"screen"},{"anonymousId":"cfe0edd5-2348-47f0-a1e4-6a3ecedf07b9","messageId":"4fda9727-48ac-40cb-856b-c6290526b02b","userId":null,"timestamp":"2024-04-30T13:22:13.209824","context":{"app":{"build":"1","name":"App Name","namespace":"com.app.name","version":"3.40.0"},"device":{"manufacturer":"Google","model":"sdk_gphone64_arm64","name":"emu64a","type":"android"},"library":{"name":"analytics-flutter","version":"1.0.0"},"locale":"en-US","network":{"cellular":false,"wifi":true},"os":{"name":"Android","version":"14"},"screen":{"height":1270,"width":720,"density":2.0},"timezone":"Europe/Ljubljana","instanceId":"5e8546bb-bba3-4ff7-b3b1-f5ab3d42d7a6","traits":{}},"integrations":null,"_metadata":{"bundled":[],"unbundled":["Actions Amplitude"],"bundledIds":[]},"traits":{"hubId":"de-hh-pauli"},"type":"identify"}]}

felixwoestmann avatar May 01 '24 08:05 felixwoestmann