When an app checks
The lifetime of an answer is set by Lerix:
- 60 seconds while a maintenance window applies to the device or starts within the hour.
- 60 seconds for 30 minutes after any release control change in the project, so lifting a block reaches open apps within a minute.
- 5 minutes the rest of the time. Apps don’t poll then: they check again on the next return to the foreground.
Silent push
When a change blocks or unblocks users, Lerix sends a silent push to every Lerix push token in the project, on iOS, Android and macOS. It shows nothing to the user; the app wakes, checks for the new state, and goes back to sleep.- It reaches apps that set up Lerix push notifications (they call the SDK’s notifications init), as in the push notifications guide of your framework. Apps without a Lerix push token pick up changes at their next check.
- It is best-effort. The operating system can delay or drop silent pushes, for example in low-power mode, which is why the regular checks continue.
- Lerix sends at most one per minute per project, and combines changes made in quick succession.
- Web pages don’t receive it. They use the checks above.
Offline behaviour
Each part of the state has its own rule for what happens when the network fails or the saved answer gets old. Blocking states fail safe for you, temporary ones fail open for your users:
The SDK corrects for a wrong device clock: each answer carries the server’s
time, and the SDK stores the difference to decide when a window starts and
ends.
Two more rules keep the saved answer honest:
- A saved update belongs to one app version. When the user installs a new version or build, the SDK drops the saved update and checks again, so an app that was just updated is never blocked by its old answer while offline.
- Deadlines pass offline too. On Android and Flutter, a saved recommended update whose Becomes required on time has passed turns into a required update without a network, as the server would have answered.
Built to fail safely
- A bad answer can’t break your app. Unknown fields, unknown values and wrong types are ignored part by part. Any error while reading the answer is caught inside the SDK.
- A device without a version is never blocked by an update rule.
- Maintenance always ends. Every window has an end time at most 7 days after its start.
- Lift all clears every blocking state in one click.
The Lerix SDK switch
The same answer can tell the SDK to pause its own work, if the Lerix team ever has to switch off a misbehaving SDK version (see the overview). While it applies:- the paused modules (errors, analytics, tracing, feedback, surveys, push token registration, or all of them) send nothing;
- anything they had queued stays on the device and is sent after the end time;
- the release control check keeps running, so the switch can be lifted.
enabled: false), the SDK stops checking, but a switch it already saved
still applies until its end time.