Skip to content

@snowplow/browser-tracker | missing outQueue collector url #1283

Open
@ghost

Description

Description
We encounter error logs when executing "disableAnonymousTracking()" alongside an out-queue in local storage containing items; before any event is sent and therefore bloat the monitoring system with error logs and also loose events from the out-queue.

To Reproduce

  1. The collector has anonymousTracking disabled and therefore set to false;
    stateStorageStrategy is set to "cookieAndLocalStorage"
  2. Make sure that disableAnonymousTracking() gets immediately executed before any new event is triggered
    (e.g. in an effect when using react)
  3. Open the page/app, start a session and make sure that events land in the local storage out-queue when e.g. leaving the page.
  4. Return and open the page/app again with an out-queue containing items to be processed;
    disableAnonymousTracking()will get called as in step 2) | make sure that no event has been sent before
  5. Now the events in the out-queue which are start being processed are failing because there is no collector url defined

Expected behavior
I would either expect more documentation on the behavior or pitfalls of executing the disableAnonymousTracking() function;
or that the events within the out-queue are somehow correctly1) processed.

1) It's hard for me to say at this point what exactly that might be.

Screenshots
none

Desktop (please complete the following information):

  • OS: macOS Sonoma 14.2.1 (23C71)
  • Browser: chrome
  • Version: 120.0.6099.216 (Official Build) (arm64)

Additional context
We could also configure the tracker correctly in the first place, and not call disableAnonymousTracking() when anonymousTracking is already disabled. Either way, it should not interfere in this case, as this will prevent pending events from the out-queue from being processed successfully.

I am aware that the steps to reproduce are kept quite minimal; but may be sufficient.
Please do not hesitate to let me know if you need any additional info or context.

Metadata

Assignees

No one assigned

    Labels

    type:defectBugs or weaknesses. The issue has to contain steps to reproduce.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions