Artifacts Associated With Ticket bf37ba145c
Ticket change [0ce9a1077c] (rid 8334) by dmestas on 2026-11-28 15:43:44:
- comment initialized 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 initialized to: "Important"
- status initialized to: "Open"
- title initialized to:
Remote: a forked conversation syncs empty on the phone: the follow reads only the fork's own submissions
- type initialized to: "Code_Defect"
- comment initialized to:
Ticket change [66dded4af2] (rid 8340) by quarry on 2026-11-28 16:01:04:
- Untracked field number: "124"
Ticket change [2cbc18c441] (rid 8419) by dmestas on 2026-11-28 18:23:50:
- icomment:
Landed as a05ac3d2b8dc (land fork-follow): a fork syncs, pages and attaches over its whole path.
- mimetype: "text/x-markdown"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- icomment: