Commit f6bc1e5
committed
fix(desktop): route prevent-sleep writes through the side-effecting IPC
The generic store-set/store-delete/store-clear IPCs could write the
preventSleep key in the settings store without starting/stopping the
powerSaveBlocker, desyncing the persisted setting from the running
blocker (a string "false" even resolved back to enabled on next
launch).
- store-set: reject writes to the preventSleep key; the dedicated
set-prevent-sleep IPC is now the single write path
- store-delete/store-clear: after touching the settings store,
re-sync the blocker via syncPowerSaveBlocker() so the reset to the
default-on behavior takes effect immediately
Verified with the macOS prevent-sleep smoke (4/4) plus a Playwright
guard check: rejected store-set leaves the assertion running, and
store-delete/store-clear restore the NoIdleSleepAssertion.
Signed-off-by: thomas-yanga <odie_majere@outlook.com>1 parent 8b21551 commit f6bc1e5
2 files changed
Lines changed: 17 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
93 | 94 | | |
94 | 95 | | |
95 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
96 | 102 | | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| 106 | + | |
| 107 | + | |
100 | 108 | | |
101 | 109 | | |
102 | 110 | | |
| 111 | + | |
103 | 112 | | |
104 | 113 | | |
105 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
0 commit comments