SessionHelper class
Session management — extracted from the old event.dart SessionHelper. Adds delivery tracking, pending session start queue, timestamp normalization. Removes session_end logic entirely.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
onLookupEventPresence
↔ Future<
bool?> Function(String eventName, int tsMillis)? -
getter/setter pair
-
onRecordEvent
↔ Future<
void> Function(Event event)? -
Callback type for recording events (injected from main tracker).
getter/setter pair
Static Methods
-
configureTestHooks(
{Future< void> pendingSessionStartsMutationHook(String operation)?}) → void -
getCurrentSessionId(
) → String -
getCurrentSessionStart(
) → int -
getLastEngagementTs(
) → int -
getLastEventTimestamp(
) → int -
getPendingNonDurableTimestamps(
) → List< int> - Get pending (non-delivered) session starts for replay.
-
getSessionNumber(
) → int -
hasActiveSession(
) → bool -
increaseSessionNumber(
) → Future< void> -
isSessionExpired(
int currentTs) → bool -
markAllPendingSessionStartsNonDurable(
) → Future< void> - Mark all pending session_starts as non-durable (when DB rebuild happens).
-
markSessionStartDelivered(
int tsMillis) → Future< void> - Mark a session_start as delivered (called after HTTP 200).
-
reconcilePendingNonDurableSessionStarts(
Future< bool?> lookupEventPresence(String eventName, int tsMillis), Future<void> persistEvent(Event event), {required bool allowReplayWithoutSignal}) → Future<bool> -
replayPendingNonDurableSessionStarts(
Future< void> persistEvent(Event event)) → Future<void> - Rebuild non-delivered session_start events after local storage loss.
-
resetStaticState(
) → void - Reset cached static state. Must be called when the SDK is re-initialized to prevent stale in-memory values from a previous session.
-
setCurrentSessionStart(
int ts) → Future< void> -
setLastEventTimestamp(
int ts) → Future< void> -
startSession(
) → Future< void>
Constants
- sessionTimeout → const int