rotateSession static method

SessionState rotateSession(
  1. SessionState? state,
  2. int now,
  3. String firstEventId,
  4. String firstEventTimestamp,
)

Implementation

static SessionState rotateSession(
  SessionState? state,
  int now,
  String firstEventId,
  String firstEventTimestamp,
) {
  return SessionState(
    sessionId: now,
    sessionIndex: state == null ? 0 : state.sessionIndex + 1,
    previousSessionId: state?.sessionId,
    firstEventId: firstEventId,
    firstEventTimestamp: firstEventTimestamp,
    eventIndex: 0,
    lastActivityAt: now,
    backgroundedAt: null,
  );
}