Keep a pending idle action on its deadline when the timings change
With 0 meaning off, setting the screensaver to 0 while the screensaver is up moves the first idle deadline to the lock's, which turns the pending lock's bound interval to 0 and locks at once, minutes early. Set each timer's interval when the cycle starts, so a change to shell.json takes effect from the next cycle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
This commit is contained in:
1 parent
377b15be4b
commit
3839d0b4e0
2 files changed
+20
-4
No files matched your search
@@ -41,6 +41,16 @@ assert(
|
||||
/id: lockTimer[\s\S]*?onTriggered: if \([^)]*root\.lockEnabled\) root\.lockSystem\("lock-timeout"\)/.test(serviceSource),
|
||||
'idle does not fire a pending lock once its timeout is set to 0'
|
||||
)
|
||||
assert(
|
||||
/lockTimer\.interval = root\.lockDelaySeconds \* 1000\s*\n\s*lockTimer\.restart\(\)/.test(serviceSource) &&
|
||||
!/interval: root\.lockDelaySeconds/.test(serviceSource),
|
||||
'idle keeps a pending lock on its deadline when shell.json changes mid-cycle'
|
||||
)
|
||||
assert(
|
||||
/screensaverTimer\.interval = root\.screensaverDelaySeconds \* 1000\s*\n\s*screensaverTimer\.restart\(\)/.test(serviceSource) &&
|
||||
!/interval: root\.screensaverDelaySeconds/.test(serviceSource),
|
||||
'idle keeps a pending screensaver on its deadline when shell.json changes mid-cycle'
|
||||
)
|
||||
|
||||
assertDeepEqual(idle.eventParts({ data: 'a,b,c' }, 2), ['a', 'b', 'c'], 'idle parses raw event data')
|
||||
assertDeepEqual(
|
||||
|
||||
Reference in new issue
Block a user