touchDevice abstract method

Future<Either<RepositoryFailure, Unit>> touchDevice()

Marks this device as active by updating lastActiveAt.

Updates the device document's lastActiveAt timestamp to indicate recent activity. Used by backend to determine:

  • Which devices are "active" for notification delivery
  • Which devices to clean up as stale

Throttling

Default throttle is 60 minutes to avoid excessive writes. Configurable via Remote Config (dreamic_device_touch_throttle_minutes).

When Called

  • On app resume from background (throttled)
  • After registerDevice (implicitly updates lastActiveAt)

Server Behavior

Uses upsert semantics: if the device doc doesn't exist, it will be created with minimal fields (deviceId, lastActiveAt, updatedAt).

Returns

  • Right(unit) on success
  • Left(RepositoryFailure) on failure

Implementation

Future<Either<RepositoryFailure, Unit>> touchDevice();