Story reactions survive a restart, and ride the backup

They lived in a map in memory. An author watched a tally empty itself
overnight and the reactor watched their own reaction disappear, and there
was nothing on screen to say either had happened. The iPhone was fixed
yesterday; this is the other half.

The vault keeps them now, loaded when the session opens and written on
every change, withdrawals included. The export carries them too, in the
same shape the iPhone reads, so a tally survives a move between the two
phones as well as a restart. Import merges per reactor rather than per
story: two devices can hold different halves of one story's tally, and
taking a story's map wholesale would drop the other half.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Paul Hitt
2026-09-16 14:06:19 -04:00
co-authored by Claude Opus 5
parent 38e31fc5ee
commit fd3a52b35c
6 changed files with 250 additions and 1 deletions
@@ -133,6 +133,13 @@ object BackupPayload {
root.put("groupSecrets", out)
}
// Who reacted to which story, keyed by story then by reactor. The
// iPhone writes and reads the same shape, so a tally survives a move
// between the two.
internal.optJSONObject("storyReactions")?.takeIf { it.length() > 0 }?.let {
root.put("storyReactions", it)
}
return root
}
@@ -299,6 +306,10 @@ object BackupPayload {
out.put("groupSecrets", secrets)
}
shared.optJSONObject("storyReactions")?.takeIf { it.length() > 0 }?.let {
out.put("storyReactions", it)
}
return out
}