test(search): red pin for snapshot invalidation
CI / ci (push) Canceled after 0s
CI / ci (push) Canceled after 0s
The mounted search snapshot is keyed only to the trimmed query, so library mutations never restart the sweep: archived/trashed rows linger in the results and edited bodies never enter them until the query changes or the view remounts. Pin the invalidation contract at controller level, the way the pure seam is pinned: LibrarySearch.SearchKey (query + Home + the model's content revision) and the LibrarySearch.Snapshot isFresh gate decide whether a landed sweep may render. The rail pins drive the real rescan path and prove archive, trash, and a same-query body edit each move PostsModel.contentRevision. The property is a stub here — never bumped — so those three pins fail red on this commit.
This commit is contained in:
1 parent
5915178ce8
commit
c0cd60b798
3 files changed
+146
No files matched your search
@@ -96,6 +96,15 @@ final class PostsModel {
|
||||
/// all times (#107).
|
||||
private(set) var posts: [Post] = []
|
||||
|
||||
/// #144 (mounted half): the library content revision — the search
|
||||
/// snapshot's invalidation signal. The rescan rail bumps it whenever
|
||||
/// a scan sees the library change: a Post-list change OR any re-read
|
||||
/// post.md (a body-only edit compares equal as a Post — #143's skip
|
||||
/// keeps the list still — yet the search must re-sweep). The `posts`
|
||||
/// assignment skip stays untouched: panes never regroup on bumps,
|
||||
/// only the mounted search re-keys.
|
||||
private(set) var contentRevision = 0
|
||||
|
||||
/// The selected Post's id; nil = nothing selected (empty editor).
|
||||
/// #146: setter internal — the split-out domain extensions set it.
|
||||
var selectedPostID: String?
|
||||
|
||||
Reference in new issue
Block a user