Repository navigation
Index: settled threads are read by page, not carried in the snapshot - #1205
Merged
Merged
Conversation
The index snapshot carried every unarchived thread. On a machine with 6369 of them, 1975 of 1990 listed threads settled and the rest what they started, that was a 6.2 MB line on every connect, and a phone reconnects on every return to the foreground. The snapshot now carries the threads that descend from no settled thread. The summary counts each project's settled threads and dates each project by the threads left out. A Settled shelf reads its rows from the host, ten when it opens and twenty-five for each Show more; opening a thread outside the index reads it with what it started; the palette and the composer's @ menu ask the host for the settled threads a title names. After the snapshot the topic still carries every thread's changes. A client holds what it read beside the index, reads it again after a reconnect, and fingerprints only what the index carries, so an unchanged index is still answered as unchanged. On that machine's data the snapshot is 221 KB and 246 threads. docs/remote.md said a conversation opens on its latest 200 records; the code reads 400.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The index snapshot carried every unarchived thread. It now carries the threads that descend from no settled thread; the rest are read when shown.
After the snapshot the topic still carries every thread's changes, so a thread that settles stays held and one that reopens enters the index.
Evidence
After: 221,049 bytes with 246 threads; a page of 25 settled threads is 26,876 bytes.
cargo fmt --all --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo nextest run --workspace --locked: 1547 passed.cargo machete. Not looked at in the running app.New tests:
the_index_leaves_settled_threads_to_pages_and_families(runtime): the snapshot's threads, activity and count; a page, the page after a cursor, a family.settled_pages_are_held_beside_the_index(ui store): after reading a page the reconnect fingerprint is still the index's, and a new index keeps the page. It fails if the fingerprint covers what is held from outside the index.Tests whose driver changed, assertions kept. Each read a settled thread out of the snapshot; a client now reads it by page or family, so the driver does:
TestEntity::subscribe(Topic::Index)reads the settled threads and their families as a client with every shelf open does (settled by step 1 of the process: the driver did not behave as the app).cold_lifecycle_migrates_legacy_settlement_and_ages_from_events_after_rename,an_old_profiles_activity_backfills_and_updates_the_index, andmove_tests'listed, which read the raw snapshot, also read the settled page.settled_shelf_pages_without_expanding_for_selection_and_navigation_matches_rows,the_threads_list_keeps_its_offset_across_the_shelf_and_selection,the_project_view_keeps_a_settled_shelf_per_project: their scripted host answers the page and family queries (host_index,answer_outside_index), and a click waits for the answer.a_settled_row_swipes_back_to_activewaits for the shelf's page from its real host.A failure these exposed and the change fixes: an open thread the new index does not carry was closed as gone. It now stays until the host answers for it.
docs/remote.mdsaid a conversation opens on its latest 200 records;BASELINE_RECORDSis 400.Merge Danger
Door: two-way
The store is untouched; reverting restores the old snapshot.
Blast Radius: wire
The wire changes under
PROTOCOL_VERSION34, noted under Unreleased. A v0.5.2 client on a host built from this shows empty Settled shelves; a client built from this cannot decode a v0.5.2 host's index summary. A thread settled a moment ago shows on its shelf one round trip after the shelf opens. The phone's Arrange threads page lists the settled threads its shelf has read.