Skip to content

Offline storage doesn't persist events #382

@snazarkoo

Description

@snazarkoo

This is a...

  • 🪲 Bug Report
  • 🚀 Feature Request
  • 📜 Documentation Request

Which version of Redux Beacon are you using?

  • v2.1.0

Which target(s) are you using?

  • Google Analytics
  • Google Analytics (gtag)
  • React Native Google Analytics
  • Google Tag Manager
  • React Native Google Tag Manager
  • Amplitude
  • Segment
  • React Native Segment
  • Other/Third Party: ...(custom Firebase target)

🪲 What are the steps to reproduce your issue?

  1. Go offline
  2. Invoke events

🪲 What did you expect to happen?

Events should be persisted in the storage and sending later once connection is established

🪲 What happened instead?

Events are not persisted

Can you help out?

The problem is located here. Potential fix is described below:

         else {
-            offlineStorage.saveEvents(e);
-            ifLoggerLog(e, action, prevState, true, false);
+            if (!isEmptyArray(e)) {
+                offlineStorage.saveEvents(e);
+                ifLoggerLog(e, action, prevState, true, false);
+            }
         }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions