@zaplier/sdk 1.7.8 → 1.7.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -21947,6 +21947,23 @@ class ZaplierSDK {
21947
21947
  if (this.config.debug) {
21948
21948
  console.log("[Zaplier] Replay batch result:", result);
21949
21949
  }
21950
+ // CRITICAL: Synchronize session ID if backend returned a normalized one
21951
+ // This ensures all tracking components use the same session ID
21952
+ if (result.sessionId && result.sessionId !== this.sessionId) {
21953
+ const oldSessionId = this.sessionId;
21954
+ this.sessionId = result.sessionId;
21955
+ if (this.config.debug) {
21956
+ console.log("[Zaplier] Session ID synchronized from replay response:", {
21957
+ oldSessionId,
21958
+ newSessionId: this.sessionId,
21959
+ originalSessionId: result.originalSessionId
21960
+ });
21961
+ }
21962
+ // Update all tracking engines with the normalized session ID
21963
+ if (oldSessionId !== this.sessionId && this.sessionId) {
21964
+ this.updateTrackingEnginesSessionId(this.sessionId);
21965
+ }
21966
+ }
21950
21967
  return result;
21951
21968
  }
21952
21969
  catch (error) {