summaryrefslogtreecommitdiff
path: root/src/Messages.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/Messages.zig')
-rw-r--r--src/Messages.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Messages.zig b/src/Messages.zig
index 0652f974..00352afe 100644
--- a/src/Messages.zig
+++ b/src/Messages.zig
@@ -208,7 +208,9 @@ fn nowMs() i64 {
/// 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 or served.
+/// 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.
/// 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.
pub fn expireUnattended(p: *Pardes) void {
@@ -570,7 +572,10 @@ 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.
_ = p.serveFs(.{ .tag = 1, .op = .read, .node = @intFromEnum(ctlfs.TopFile.index), .size = 64 });
+ try std.testing.expect(pane.msg_len > 0);
+ expireUnattended(p);
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.