From f897153a1196f23fe0d82dc703d98df1363bf3fc Mon Sep 17 00:00:00 2001 From: "Danilo M." Date: Fri, 14 Aug 2026 18:41:10 +0200 Subject: docs: close item 36, narrow item 66 with a negative result Item 36's section moves to the closed file and its three traps go into CLAUDE.md, which is where they will be read: the worker is unreachable by findChild, rowCount on an unexpanded thread row is 0 by design, and currentThreadId reports intent rather than content. The claim that this class of bug cannot be reproduced in test_mainwindow is now false, so it is corrected rather than left standing beside its replacement. One in-test reference to item 36 as a permanent limitation is reworded: bare-window cases still have no worker, but that is now a choice per case rather than a property of the binary. Item 66 stays open with the simple case ruled out. The negative result sharpens this entry's own candidate rather than contradicting it: the test drives setCurrentIndex, which updates the selection model synchronously, while the suspect guard turns on a real click not having done so yet. Two cheaper conditions are named as still unexcluded. Co-Authored-By: Claude Opus 5 --- CLAUDE.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'CLAUDE.md') diff --git a/CLAUDE.md b/CLAUDE.md index f6f9996..a9cf33c 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -398,13 +398,36 @@ standalone program containing none of this project's code. A size assertion there passes against both, and a mutation putting the bug back leaves the suite green. Assert on the stored value, and leave the frame to a hand test. +**`test_mainwindow` can now drive a real worker, and three things about it will +waste a session each.** `WorkerBackedWindow` builds a throwaway notmuch +database and writes a `qtmaildir.conf` pointing at it; `wireWorker()` reads +`notmuch_config` like any other key, so no production hook exists or is needed. +It is opt-in per test because the fifty-odd bare-window cases must not pay for a +`notmuch new`. The three traps, all found by a probe that reported success while +measuring nothing: + +- **The worker is unreachable by `findChild`.** It is created parentless and + moved to its own thread, so it is not in the window's hierarchy. Wait on + observable state with `QTRY_VERIFY_WITH_TIMEOUT`, never on worker signals and + never on a fixed `qWait(n)`, which passes when the result never arrives. +- **`rowCount()` on a thread row is 0 until the thread is expanded**, since + children are populated by the expansion. `hasChildren()` is the pre-expansion + question and falls back to `summary.totalCount > 1`. An assertion on + `rowCount` fails against correct code. +- **`currentThreadId()` reports INTENT, not content.** It is assigned + synchronously in the selection handler before any worker round-trip, so a test + asserting on it passes with `onThreadLoaded()` disabled entirely, measured. + `MessageView::showingPlaceholder()` is what the user sees; assert the pane is + blank BEFORE the gesture so the check after it means something. + **A queued load can outlive the state that started it.** `loadThread` crosses to the worker on a queued connection, so its reply lands after whatever the UI did in the meantime. The generation counter covers a superseded *query*, not a superseded *selection*: blanking the pane and then receiving an in-flight thread repaints it. `onThreadLoaded` therefore drops a -reply that arrives while more than one row is selected. This class of bug cannot be -reproduced in `test_mainwindow`, which has no worker and never fires `threadLoaded`; it -needs the notmuch fixture or a hand test. +reply that arrives while more than one row is selected. This class of bug USED to be +unreproducible in `test_mainwindow`, which had no worker and never fired `threadLoaded`. +Item 36 changed that: `WorkerBackedWindow` (above) gives a test a real worker, and the +`onThreadLoaded` guard is covered by one. **Do not conclude a key binding is dead from `QTest::keyClick()`.** Whether a symbol needs Shift is a layout property, not a Qt one. `Ctrl++` is the shipped `zoom_in` default and is -- cgit v1.2.3