Skip to content

v1.8.11 — Secondary FlutterEngine Guard

Choose a tag to compare

@GalacticTitan GalacticTitan released this 16 Apr 16:17
· 3021 commits to main since this release
v1.8.11
f86beef

Fix

  • Geofence callbacks no longer silently stop during continuous tracking when a secondary FlutterEngine (e.g. Firebase background messaging) registers the plugin (#51).

Root Cause

When FirebaseMessaging.onBackgroundMessage() fires, Firebase creates a temporary FlutterEngine. GeneratedPluginRegistrant.registerWith() creates a new Tracelet plugin instance on that engine, which unconditionally:

  1. Replaced the SDK singleton's event sender with one connected to Firebase's short-lived isolate
  2. On detach, called sdk.destroyAll() — tearing down the primary tracking session

Fix

A static primaryInstance guard on both Android (TraceletAndroidPlugin) and iOS (TraceletIosPlugin) ensures only the first plugin instance wires SDK state. Secondary instances get Pigeon HostApi only — they cannot corrupt the singleton.

Packages Updated

Package Version
tracelet 1.8.11
tracelet_ios 1.8.11
tracelet_web 1.8.11

Native SDKs unchanged at 1.0.10.