summaryrefslogtreecommitdiff
path: root/core/replica.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 20:51:03 -0300
committerGabriel Schneider <[email protected]>2026-11-20 00:01:22 -0300
commit1d6160072e474f8c07987ffe0b58de5d7576002b (patch)
tree4b643af5f5261bfc25c17d6f699094c6fbcf8dfa /core/replica.zig
parent0db34fbf28e70c8c6a3c6025c0888fc5ec75201c (diff)
downloadpardes-1d6160072e474f8c07987ffe0b58de5d7576002b.tar.gz
pardes-1d6160072e474f8c07987ffe0b58de5d7576002b.zip
far client: a window's keyboard found again no longer asks the session's host whether a newer build is installed: the core's focus step called the Host's `newer_build` (core/Core.zig, the `.focus` branch of updateInner), an entry that answers, so a far client's refocus stopped and its first keys after it waited a round trip, for a question about the SESSION's binary that the client's window has nothing to do with (and a client's own binary nobody looked at: tui's entry said false for a client); each process's build is now its own frontend's to look at, at its own focus-in, between steps: the tty session calls `upgrade.noticeNewer` as the window session already did (gui.zig), its line an input (`setMessage`, taped) that its clients replay; a client's refocus asks no one; the entry `newer_build` is gone from dev/Host.zig and tui.zig, and its row "focus lost and found" from may_wait (the walk would now call it stale); the test `a far client's window found again is instant: ...` (end of core/replica.zig) failed on the base with `expected 1, found 0` (applied: the refocus stopped) and passes; the walk over every word and key passes in core-test and shell-test; gates on the seven together (the stack's top, load 18 to 50 beside them): tui core-test 855/999 (144 skipped), shell-test 1035/1038, pane-test 183/184, term-test 15/15, kitty-test 45/45, behaviour-test 275/275 and --replay 20 seeds 0 failures, process-test 3 of 144 (lspcomplete and lspcompletemoved, the base's, and headersweep-restored, which passes alone), gui unit-test 1633/1637 with the base's BaselineHarnessMismatch; replicas --clients 5 and --seeds 8: diverged 0, unequal 0, deltas wrong 0, quiet checks differed 0, unlisted stops 0, corpus 22 of 22, no leak report; the walk over every word and key passes; frame and perf gate against tree1 (farfaults): frames 77/77 byte-identical in Debug, unit-test 1633/1637, perfab corpus2x -0.087% (noise 0.092%, bar 0.4%, pictures identical), perfops 97 counts within 0.1% (largest +0.0329%)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'core/replica.zig')
-rw-r--r--core/replica.zig24
1 files changed, 23 insertions, 1 deletions
diff --git a/core/replica.zig b/core/replica.zig
index c68848f2..a13acada 100644
--- a/core/replica.zig
+++ b/core/replica.zig
@@ -5342,7 +5342,6 @@ const may_wait = [_]Wait{
.{ .what = "Dump", .on = .any, .stop = "write_dump", .why = "a dump written" },
.{ .what = "Upgrade", .on = .any, .stop = "upgrade", .why = "the session execs itself" },
.{ .what = "Detach", .on = .any, .stop = "detach", .why = "the session lets its frontend go" },
- .{ .what = "focus lost and found", .on = .any, .stop = "newer_build", .why = "a window found again asks whether a newer build is installed: the session's disk" },
// What the session alone holds: its closed panes, Recent and History
// (every session of its user writes them), the config and theme files.
.{ .what = "Restore", .on = .any, .stop = "the authority's own state", .why = "the session's dumps" },
@@ -5884,3 +5883,26 @@ test "an idle client's check answered covers the units that came while it was as
c.take(.{ .checked = digestOf(a) });
try std.testing.expect(!c.asked and c.changed);
}
+
+// A window's keyboard found again asked the session's host whether a newer
+// pardes is installed, in the core's focus step: a client's refocus waited
+// a round trip for a question about the session's binary that its own
+// window has nothing to do with. Each process's build is its own frontend's
+// to look at, at its own focus-in (upgrade.noticeNewer).
+test "a far client's window found again is instant: its refocus asks the session's host nothing, and the session's unit confirms it" {
+ const gpa = std.testing.allocator;
+ const a = try Authority.init(gpa, .{ .cols = 80, .rows = 24, .file = "mise.toml" }, FullHost.host(), false);
+ defer a.deinit();
+ const r = try joinedFresh(a);
+ defer r.deinit();
+ for ([_]bool{ false, true }) |focused| {
+ const msg = try gpa.dupe(u8, try r.input(.{ .focus = focused }));
+ defer gpa.free(msg);
+ try std.testing.expectEqual(@as(usize, 1), r.applied);
+ r.confirm(try a.take(msg));
+ r.settle();
+ try agrees(a, r);
+ }
+ try std.testing.expectEqual(@as(u32, 0), r.stats.stopped);
+ try std.testing.expectEqual(@as(u32, 2), r.stats.fast);
+}