fix(study): refresh the session's cards on returning from the PDF backlink #836

Merged
raisondetredev merged 1 commit from refs/pull/836/head into main 2026-08-11 16:35:58 +02:00
raisondetredev commented 2026-08-11 16:35:44 +02:00 (Migrated from codeberg.org)

The card header's PDF chip pushes the creator, where the card list offers
the full editor and Delete. Fix a card there, come back, and the session
kept showing the copy it had: the queue is a snapshot taken at load, and
the push was fire-and-forget, so nothing ever told the session its cards
had moved on.

The chip now awaits its push — the future completes when the user returns,
however deep they went — and the bloc re-reads every card still in queue
and graduated, one local point-read per card in parallel, the same shape
the load path's hydration already uses. graduated is included because
cram cycles that pile back into the queue on wraparound, where a stale
card would otherwise resurface later in the same run.

An edited card is swapped in place: the active card keeps its slot, its
previews and its revealed face, so you land back on the card you left with
the text you went off to fix. A card that vanished meanwhile — soft-deleted,
or retired — drops out exactly as an in-session delete does: no history
entry, undo availability untouched, advancing (or completing, or wrapping
in cram) when it was the card being studied.

Best-effort throughout. A failed read, a session that finished while the
read was in flight, and a rating mid-commit all emit nothing at all, as
does a refresh that found no news — a stale card beats a queue yanked out
from under the user.

Tags come along on the same return trip: the editor manages them too.

Signed-off-by: Tizian 「ティツィアーン」 raisondetredev@pm.me

The card header's PDF chip pushes the creator, where the card list offers the full editor and Delete. Fix a card there, come back, and the session kept showing the copy it had: the queue is a snapshot taken at load, and the push was fire-and-forget, so nothing ever told the session its cards had moved on. The chip now awaits its push — the future completes when the user returns, however deep they went — and the bloc re-reads every card still in `queue` and `graduated`, one local point-read per card in parallel, the same shape the load path's hydration already uses. `graduated` is included because cram cycles that pile back into the queue on wraparound, where a stale card would otherwise resurface later in the same run. An edited card is swapped in place: the active card keeps its slot, its previews and its revealed face, so you land back on the card you left with the text you went off to fix. A card that vanished meanwhile — soft-deleted, or retired — drops out exactly as an in-session delete does: no history entry, undo availability untouched, advancing (or completing, or wrapping in cram) when it was the card being studied. Best-effort throughout. A failed read, a session that finished while the read was in flight, and a rating mid-commit all emit nothing at all, as does a refresh that found no news — a stale card beats a queue yanked out from under the user. Tags come along on the same return trip: the editor manages them too. Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
project-halkyon/halkyon-learn!836
No description provided.