utils/sickdays/sickdays
Krzysztof kuhy Rudnicki 7f2443ce48
Some checks failed
dependency freshness / dependencies on newest stable (push) Waiting to run
file length / file-length (push) Waiting to run
md-naming / markdown naming convention (push) Waiting to run
palette drift / palette (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
shared gate tests / gate unit tests (push) Waiting to run
sickdays pre-commit / pre-commit (push) Has been cancelled
sickdays tests / test (push) Has been cancelled
sickdays.gui: refuse a write while a background sync is in flight
sync() reads the pool, waits on the network, then writes its merged copy
back without a lock. A second write landing inside that window was
silently overwritten. Marking day A and then clearing day B within a
second or two lost the clear, so B stayed a sick day.

Every background sync now holds a module lock, and each write tries it
without blocking. A click that lands mid-sync shows "Syncing -- try again
in a moment." in the panel and calls on_saved with nothing. The phone's
picker avoids the same race by making the grid inert while it syncs.

The red-first test pins the lost write with a sync stub that reads, waits,
then writes back.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PAhbNszs5JKdtnD4uBi3xp
2026-10-17 13:51:26 +02:00
..
gui sickdays.gui: refuse a write while a background sync is in flight 2026-10-17 13:51:26 +02:00
tests sickdays.gui: refuse a write while a background sync is in flight 2026-10-17 13:51:26 +02:00
__init__.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
__main__.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_api.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
_audit.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
_cli_output.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_cli.py sickdays 0.3.0: desktop sick-day picker and embeddable KeepPanel 2026-10-17 13:47:26 +02:00
_conflict.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_constants.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
_day.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_errors.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_hmac.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_keep_api.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
_keep.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
_model.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
_paths.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_store.py sickdays: a non-UTF-8 pool file fails closed instead of raising 2026-10-16 08:25:00 +02:00
_sync.py sickdays 0.1.0 + earned_time 0.11.0: uncapped sick-day pool, 20:00 sick shutdown floor 2026-10-16 08:23:00 +02:00
_writes.py sickdays 0.2.0: per-locker keep set on a sick day 2026-10-16 15:08:06 +02:00
py.typed sickdays: ship py.typed so consumers type-check against it 2026-10-16 13:37:31 +02:00