Product Benefits Pricing Guides Docs About Contact us Try it out
Performance

Mixpanel Swift Queue Flush and Reset Tracking

Mixpanel Swift 6.8 batches flushes and keeps queued events through reset(). Track queue health and flush failures in your iOS app.

· 3 min read

Event queues are where mobile analytics quietly breaks. A user taps around offline, logs out, comes back, and the events that should explain their journey are gone or attributed to the wrong person. Mixpanel Swift 6.8.0 changes several queue behaviours that affect exactly this.

According to the release notes, it fixes an NSMallocException crash in the flush pipeline, with flushes now sending the full queue in batches of up to 50, one batch in memory at a time. Setting flushInterval to 0 no longer triggers a flush, and flushInterval is deprecated in favour of MixpanelOptions. Calling reset() no longer deletes queued events, group updates or identified people updates, and queued people updates keep the distinct ID they were tracked with. Unreadable database rows are deleted instead of blocking the queue.

Without tracking, you cannot tell whether these fixes helped, or whether a changed default is delaying your data.

Data Points to Track

  • queue_size_at_flush: events waiting when a flush starts
  • flush_batch_count: batches sent in one flush
  • flush_duration_ms: time from first to last batch
  • flush_result: success, network_error or server_error
  • reset_called: true when reset() ran this session
  • events_queued_at_reset: how many events were waiting when it did
  • flush_interval_seconds: the configured value, including 0
  • crash_in_flush: crashes with the flush pipeline in the stack trace

Setup Steps

  1. Upgrade to Mixpanel Swift 6.8.0 or later.
  2. Search your code for flushInterval and move the value into MixpanelOptions.
  3. Remove any use of 0 as a way to switch off flushing; it no longer triggers one.
  4. Review every reset() call. Decide whether you now want queued events to survive logout.
  5. Log queue_size_at_flush from your own wrapper before each manual flush.
  6. Record reset_called and events_queued_at_reset on a separate diagnostic event.
  7. Add a breadcrumb to your crash tool whenever a flush starts.
  8. Compare crash rates and event delivery between 6.7 and 6.8 builds.

Actionable Insights

If queue size at flush keeps growing, your interval is too long or users are rarely online. Shorten the interval or flush on background.

If events survive reset, check that anything queued before logout is not now attached to the wrong account. The notes say queued people updates keep their original distinct ID, which should help, but verify it with a test account.

If flush crashes disappear after upgrading, record that in your release notes so the next team does not revert the change.

Common Pitfalls

Do not rely on flushInterval set to 0 to hold events back.

Do not assume reset() clears the queue any more.

Do not measure delivery without knowing the batch size, since large queues now take several requests.

Rolling It Out Safely

Test the logout and login path on a real device with the network off. Queue several events, call reset(), sign in as a different user, then reconnect and inspect what arrives and under which ID. Repeat with a large queue to see the batching in practice. Keep the results with your release notes, and repeat the test whenever you change your identity or consent logic.