diff options
| author | Gabriel Schneider <[email protected]> | 2026-10-30 16:50:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-30 17:40:51 -0300 |
| commit | d92ea9dfdd9198b69bff420c3b594f0ffed1e1bb (patch) | |
| tree | f9102920bad857c51aa7103ec4ae8b621d706213 /src/Messages.zig | |
| parent | 5938a84d98815818598f5505646edec762089270 (diff) | |
| download | pardes-d92ea9dfdd9198b69bff420c3b594f0ffed1e1bb.tar.gz pardes-d92ea9dfdd9198b69bff420c3b594f0ffed1e1bb.zip | |
Messages: a detached session's messages go on the clock in the pump, after its wait, not in the host's wait: the host's call (tty waitInput, gui waitDetached) was no input, its clock read untaped, so a replay (and every replica of a session nobody attached) kept a message its session had let go; with MessageLinger 0 (test/daemon.py's sessions) a tape whose session said a failure never replayed, on main too (pane 0's msg, digest 6, 7 of 7 runs; 0 of 6 after); test/cross_replay.py's session says MessageLinger 0 again
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/Messages.zig')
| -rw-r--r-- | src/Messages.zig | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Messages.zig b/src/Messages.zig index e1d18849..371ed168 100644 --- a/src/Messages.zig +++ b/src/Messages.zig @@ -216,9 +216,10 @@ fn showMessage(p: *Pardes, id: usize, text: []const u8, stack: bool) void { /// With no frontend attached no input dismisses a message, and a detached /// session's /screen and messages kept what was said an hour ago: each /// pane's lines go once its newest has been up `message_linger_ms`, on the -/// clock, checked as the core is stepped and by the detached session's loop -/// between steps -- not as a 9P request is served, since a read is answered -/// while a step is out and must change nothing. +/// clock, checked as the core is stepped (each event, and each pump after +/// its wait, which a message wakes) -- not as a 9P request is served, since +/// a read is answered while a step is out and must change nothing, nor by +/// the host, whose call is no input a replay makes. /// ponytail: a pane's older lines go with its newest, not each on its own /// clock; the render pipeline's clock will give every line its own. fn nowMs() i64 { @@ -742,10 +743,11 @@ test "with no frontend attached a message goes once it has lingered, on the cloc // Detached with nobody attached: past its linger it is gone, and the // line above it with it. p.unattended = true; - // A read served meanwhile changes nothing; the session's loop expires. + // A read served meanwhile changes nothing; the session's step after its + // wait expires, not the host (whose call no replay makes). _ = p.serveFs(.{ .tag = 1, .op = .read, .node = @backingInt(ctlfs.TopFile.index), .size = 64 }); try std.testing.expect(pane.msg_len > 0); - expireUnattended(p); + try p.pump(.{}); try std.testing.expectEqual(@as(u16, 0), pane.msg_len); try std.testing.expectEqual(@as(u8, 0), pane.msg_older_len); // A fresh one stays until its linger is up. |
