From f30dfdb3d5546195a69f8046ded9acc669882b8d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 10 Nov 2026 04:59:03 -0300 Subject: kind: a view's facts (Kind.viewOf) count its bands as Messages.bands makes them from what a dump keeps (the pane's messages and prompt, the view's leader, rect and tag rows), never the derived copy a step or a park left in Pane.notices or Pane.pv, which a client joined from a dump has not: its kind was told other rows than the session's and the join diverged (`digest N differs in panes pane M.addon`); collectNotices makes the live view's from the same function Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/replica.zig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/replica.zig') diff --git a/src/replica.zig b/src/replica.zig index 0b22f8b2..dd6f34bc 100644 --- a/src/replica.zig +++ b/src/replica.zig @@ -4383,3 +4383,26 @@ test "a replica's word that opens a kind's pane with no file waits for the autho try agrees(a, r); try std.testing.expect(r.core().panes[r.core().view().active].?.addon != null); } + +test "a client joined from a dump tells a kind each view's facts as the session does, the live one's and another's" { + const gpa = std.testing.allocator; + const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, TestHost.host(), false); + defer a.deinit(); + var words: [64]pardes.Kind.LoadedWord = undefined; + const placed = pardes.Kind.loadedOf(&Placed.ops, "/x/placed.so", @splat(7), &words); + _ = try a.local(.{ .addon = .{ .op = .load, .pane = 0, .kind = &placed } }); + _ = try a.local(.{ .command = "Placed" }); + // A message in its pane: a band over its body, in each view. + _ = try a.local(.{ .command = "Placed x" }); + // The second client's view laid out by an input of its own, then the + // first's resized: its kind told at the session's next step of its own. + _ = try a.openView(2); + var buf: [256]u8 = undefined; + _ = try a.take(try inputOf(&buf, 2, 1, .{ .resize = .{ .cols = 80, .rows = 24 } })); + _ = try a.take(try inputOf(&buf, 1, 1, .{ .resize = .{ .cols = 80, .rows = 20 } })); + const joiner = try joinedNow(a, 3, 1); + defer joiner.deinit(); + try std.testing.expectEqual(digestOf(a), joiner.digest()); + joiner.confirm(try a.local(.tick)); + try agrees(a, joiner); +} -- cgit v1.3