Overview
| Artifact ID: | 0ce9a1077cfa4c20fa77295cf7d93136cbe2a205adb1eaf8d6551585e8bc6fb0 |
|---|---|
| Ticket: | bf37ba145c447591a3be941703ea4eac64f09fb2
Remote: a forked conversation syncs empty on the phone: the follow reads only the fork's own submissions |
| User & Date: | dmestas on 2026-11-28 15:43:44 |
Changes
- comment changed to:
A conversation made by `fork_session` (or `/fork`, `pic fork --at`) shows nothing on the phone. Following it, pic answers `sync` with a mark at 0 and no events, and earlier is absent, so the page draws an empty conversation titled "Untitled". Yet its `sessions` row says `seq` 12, `pic log` shows its entries, and the conversation it was forked from syncs normally. Reproduction (pi-c trunk a163283659ba, release build, an isolated HOME paired to a local relay): 1. From the phone, start a conversation in a folder and send two messages ("Plan the release", "And the date?"). pic log shows entries 9 to 12. 2. Send `fork_session` with no `at` to it. The answer is success, with data.session `W/3455f930`. 3. `sync` to `W/3455f930`. pic sends only `sync` (mark) at seq 0, with no `event`s and no `earlier`. The same sync to the original sends events 11 and 12, then the mark at 12 with earlier 8. 4. `pic log 3455f930` prints entries 9 to 12. Code path: `rmt_syncjob_run` (src/remote.c:6743) calls `pic_follow_new`. The follow's pass reads `pic_entry e JOIN pic_submission u ... WHERE u.session_id = ?1` (src/attach.c:489-491), and the start mark comes from `max(id) FROM pic_submission WHERE session_id = ?1` (src/attach.c:1142). Both see only the conversation's own submissions. A fork has none until its first request, because its entries are on its `forked_from` path (the recursive walk at src/loop.c:4928 that `pic log` uses). `rmt_earlier` and `pic_follow_page` (earlier pages) have the same limit. Expected: a fork's follow, earlier pages and mark cover its whole path, as `pic log` does: the inherited entries up to the fork point, then its own. The page follows a fork from `data.session` as soon as the fork is answered, so today every fork opens empty. Fix shape: have the follow, page and mark queries select entries on the session's path (the `forked_from` chain, each ancestor up to its fork point), not `u.session_id = ?1`. Add a remote test that syncs a fork and pages earlier in it. - severity changed to: "Important"
- status changed to: "Open"
- title changed to:
Remote: a forked conversation syncs empty on the phone: the follow reads only the fork's own submissions
- type changed to: "Code_Defect"