fix(session): stop the expiry warning promising a time and an ad it cannot honour

The warning said "Revolt VPN disconnects in 5 minutes" / "Watch an ad to
extend your session." Both can be wrong.

handleSessionWarningAlarm accepts the warning anywhere between
WARNING_FLOOR_MS and WARNING_LEAD_MS + WARNING_SLACK_MS remaining, so it
can say "5 minutes" with just over one left. And the ad is a dead end in
a release build: AdManager.showAd('support') is still kDebugMode-gated
(rule 87), so the support button does nothing there - and nothing at all
in a build shipped with ads off.

Say neither. The comment records what has to change for the number and
the ad to come back.

Co-Authored-By: Claude Opus 5 <[email protected]>
This commit is contained in:
esefxdzandClaude Opus 5 committed 2026-10-17 16:26:41 +03:00
1 parent 296b087db6
commit 00b84dde61
1 file changed
+9 -2
@@ -27,12 +27,19 @@ object RevoltAlerts {
private const val TAG = "RevoltAlerts" private const val TAG = "RevoltAlerts"
private const val LAUNCH_REQUEST_CODE = 2001 private const val LAUNCH_REQUEST_CODE = 2001
// Neither line names a number or a mechanism, because this notification
// cannot honour either. The caller accepts it anywhere from WARNING_FLOOR_MS
// to WARNING_LEAD_MS + WARNING_SLACK_MS remaining, so "5 minutes" can be
// off by four of them; and "watch an ad" is a dead end in a release build,
// where the support bypass is still kDebugMode-gated (rule 87). Put the
// number back once the warning is punctual, and the ad back once the
// support button works without a debug build.
fun postExpiryWarning(context: Context) { fun postExpiryWarning(context: Context) {
post( post(
context, context,
WARNING_NOTIFICATION_ID, WARNING_NOTIFICATION_ID,
"Revolt VPN disconnects in 5 minutes", "Revolt VPN disconnects soon",
"Watch an ad to extend your session.", "Open the app to extend your session.",
) )
} }