deviceTouchThrottleMinutes property

int get deviceTouchThrottleMinutes

Throttle interval in minutes for touchDevice() calls.

The device will not update its lastActiveAt timestamp more often than this interval. This reduces unnecessary writes while still keeping the device's activity status reasonably fresh for backend scheduled jobs.

Tuning guidance: If backend scheduled jobs filter by "active in last X hours", set this throttle small enough that typical users will refresh during that window. Example: For "active in last 24h" filtering, a 60-minute throttle is fine.

Can be set via:

  • Code: AppConfigBase.deviceTouchThrottleMinutesDefault = 30
  • Build flag: --dart-define dreamic_device_touch_throttle_minutes=30
  • Firebase Remote Config: dreamic_device_touch_throttle_minutes

Default: 60

Implementation

static int get deviceTouchThrottleMinutes {
  const envValue = int.fromEnvironment(
    'dreamic_device_touch_throttle_minutes',
    defaultValue: -1,
  );
  if (envValue != -1) {
    return envValue;
  } else {
    final remoteValue =
        g<RemoteConfigRepoInt>().getInt('dreamic_device_touch_throttle_minutes');
    if (remoteValue > 0) {
      return remoteValue;
    } else {
      return defaultRemoteConfig['dreamic_device_touch_throttle_minutes'] as int;
    }
  }
}