Repository navigation
Conversation
…ecovery & hub 426
…ead recovery & attend
…PUT /threads/:id/read
… monotonically in one tx
This branch has not been deployed
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
Closes Wave B6c-2a — Sync Reconnect / Burst / Catch-up / Live / Syncing / Visited-Open 10-File Test & Production Parity Closure in pure-Pion Client Core (
pion/client-core).Production Parity Fixes Closed
Incremental
thread_after& Zero-Write Duplicate SSE Replay (thread_after.pion,station_events_sse.pion)thread_aftermatchingclient/core-ts/src/station/thread-after.ts(last,unread,lastMessage,people,firstText300-UTF-8-char cap, attachment-only vs textediteditedAt, andNonefallback on sequence gaps, non-native Slack/Feishu/group surfaces, or local/non-email authors).StationEvents::apply_sse_threadso duplicate replayed SSE entries perform0entry/threadSQLite writes and leave summaries unchanged.Confirmed
own.readsRead Recovery & Post-Restart Focus Retry (cc_read_recovery.pion,cc_chat_open_sync.pion)ReadRecoveryStatetracking server-confirmedown.reads(#heldReads) and activePUT /threads/:id/readrequests so explicitchat.readrepairs stale cachedthread.readpositions on shared threads while leaving unshared threads untouched.attend_check_due_read) onclient.focus(visible && focused && end) so an interruptedPUT /threads/:id/readacross app restart automatically retries once the chat is shown and focused.Cold/Visited Chat Open Sync, Silent Backfill, F2a Catching Priority & Focused Live
said: true(cc_chat_open_sync.pion,cc_topics_chat.pion)prepare_chat_open_synchandling cold-openPOST /batch(with404 no routefallback to directGETs and retry on stream reopen / backoff), unread-around ranged jump (from=&to=), visited-chat>= 1page jump directly to latest page followed by silent older gap backfill (fill_next),< 1page immediate cached open + singleafter=catch-up read, and immediate fallback to held entries (newer: true) when already offline or going offline mid-wait.maybe_prioritize_catching_thread(F2a) scheduling focusedGET /threads/:idsummary + boundedafter=continuation onsy.laneonce percatching.epochwhile preserving the open window andunreadLine.attend_chat_view(focus_showing_chat) markingsaid: trueexclusively on non-resumed live SSE entries arriving while the chat is visible in an open window, immune to+5 min/-5 minstation clock skew.SQLite Stream-Batch Rollback Replay,
mayHurryLock Close Redial, Streaks, Down Causes & Recorder (station_events_reconnect.pion,station_events_stream.pion,cc_station_diag.pion,cc_station_hooks.pion)1000ms -> 2000mscapped backoff,marks_let_go+sync.bump_epoch()retiring hung pre-rollbackmarksreads so recovery snapshots never stall behind rolled-back state) acrossBEGIN IMMEDIATE, statement, andCOMMITfailures.mayHurryimmediate redial on the firstlock_unconfirmedstream close (>= RECONNECT_MS),costly_streak(60scap after 3 costly brief streams) vsbrief_streak(BRIEF_MAX_MS = 8scap on resumed brief streams),note_answered/healthChangefast recovery,cloud_events_openedwakeup fromOFFLINE_RETRY_MS,station_down_cause(lock,network,updating,station,unreached), 426station_too_old/app_too_old/page_too_olddiagnostics, and connection performance recorder hooks.Cloud
/v1/eventsFirst-Heartbeat Deadline & Safe Wake Socket Replacement (cloud_api.pion,cloud_sync.pion)CLOUD_SOCKET_IDLE_MS(60s) first-data deadline on/v1/eventsand non-destructive background socket dial onwake()so a failed replacement dial leaves the existing open socket intact until a subsequent wake succeeds.10-File Case-by-Case Coverage Mapping
client/core-ts/test/Suitechat-reconnect.test.ts[1]–[5]b6c2a_chat_open_reconnect_test.pion:•
b6c2a chat-reconnect [1]: failed initial read with /batch before stream resumes retries on reopen•
b6c2a chat-reconnect [2]: failed initial read with /batch after stream already resumed retries via backoff•
b6c2a chat-reconnect [3]: failed initial read without /batch before stream resumes retries on reopen•
b6c2a chat-reconnect [4]: failed initial read without /batch after stream already resumed retries via backoff•
b6c2a chat-reconnect [5]: unread position wait recovers automatically when stream resumesevent-burst.test.ts[1]–[3]b6c1_event_burst_test.pion&b6c2a_burst_lock_syncing_test.pion:•
[1]b6c1 event-burst [1]: chat.open completes asynchronously before remaining slices of a 60-event SSE burst•
[2]b6c1 event-burst [2]: overview + patches before a whole overview coalesce through live StationEvents•
[3]b6c2a event-burst [3]: flushes cursor at yield boundary and stops immediately when stream link is replaced or authGen bumps mid-burstf2a-catching-priority.test.ts[1]b6c2a_chat_open_reconnect_test.pion:•
b6c2a f2a-catching-priority [1]: opening cached thread during catching prioritizes summary + bounded continuation once per epoch and preserves unreadLinelink-lock-ended.test.ts[1]–[2]b6c2a_burst_lock_syncing_test.pion:•
b6c2a link-lock-ended [1]: station closing stream for lock_unconfirmed redials immediately and enters waiting admission state•
b6c2a link-lock-ended [2]: redials immediately only on first lock_unconfirmed close and backs off >= 2000ms thereafterread-recovery.test.ts[1]–[2]b6c2a_read_said_thread_test.pion:•
b6c2a read-recovery [1]: explicit read repairs stale cached position via confirmed own.reads and leaves unshared threads alone•
b6c2a read-recovery [2]: after an interrupted PUT /threads/7/read and restart, showing and focusing the chat retries the readreconnect-recovery.test.ts[1]–[29]b6c2a_reconnect_recovery_test.pion,station_events_wake_test.pion,wave_b3b1_test.pion,wave_b3b1_r3_test.pion:•
[1]b6c2a reconnect-recovery [1]: a lost event is read again in the same app after SQLite fails at BEGIN IMMEDIATE, statement, and COMMIT•
[2]b6c2a reconnect-recovery [2]: a replay that fills SQLite again backs off (1000ms -> 2000ms) and eventually keeps the missing message•
[3]b6c2a reconnect-recovery [3]: a snapshot held open before a rollback does not hold the recovery snapshot back•
[4]–[6]b6c2a reconnect-recovery [4]-[6]: costly brief streams back off to 60s and reset after STREAM_HELD_MS or UI wake; healthy 30s streams always retry in 2s•
[7],[8]b6c2a reconnect-recovery [7],[8]: incomplete fresh read (held across restart or 503 marks) does not persist heard cursor until all lists succeed•
[9]b6c2a reconnect-recovery [9]: failed CloudSync wake replacement keeps open socket, next wake replaces it, and 60s first-heartbeat deadline reconnects•
[10]–[15]b6c2a reconnect-recovery [10]-[15]: resumed brief cap BRIEF_MAX_MS, note_answered & healthChange fast recovery, cloud_events_opened on OFFLINE_RETRY_MS, and connection recorder•
[16]–[20],[23]–[26]b6c2a reconnect-recovery [16]-[20],[23]-[26]: down causes (lock, unreached, network, updating, station), outbox/pending recovery, and 426 appOld/pageOld/stationTooOld•
[21]–[22]station_events_wake_test.pion(wake: a freeze past STREAM_IDLE_MS...,wake: a frozen stream that stays silent goes POST_FREEZE_IDLE_MS...,wake: a stream from before a wake that breaks just after it opens again at once, once a wake)•
[27]–[29]wave_b3b1_test.pion&wave_b3b1_r3_test.pion(b3b1: behind the workspace in view until it had its first round...,b3b1: woken out of its wait, a stream of a workspace not in view opens again behind the one in view,b3b1 r4: a stream waiting behind the workspace in view is told as its wait is let go of...)said-live.test.ts[1]–[3]b6c2a_read_said_thread_test.pion:•
b6c2a said-live [1]: live message comes in with said:true while resumed replay and out-of-view messages do not•
b6c2a said-live [2]: station clock 5 minutes ahead changes nothing of what comes in•
b6c2a said-live [3]: station clock 5 minutes behind changes nothing of what comes insyncing.test.ts[1]–[3]b6c2a_burst_lock_syncing_test.pion:•
b6c2a syncing [1], [2], [3]: reports syncing through tally and remaining chats, ignores 403 thread, and clears on disconnectthread-after.test.ts[1]–[4]b6c2a_read_said_thread_test.pion:•
b6c2a thread-after [1]: advances last, unread, lastMessage, people, firstText 300-char cap, and attachment-only vs text edit•
b6c2a thread-after [2]: returns None for non-object held, sequence gap, Slack surface, and local author•
b6c2a thread-after [3]: thread_after_letters advances letters count and lettersLast and rejects gaps•
b6c2a thread-after [4]: duplicate resumed entries and letters leave summary unchanged and perform 0 entry/thread SQLite writesvisited-chat-open.test.ts[1]–[4]b6c2a_chat_open_reconnect_test.pion:•
b6c2a visited-chat-open [1]: >= 1 page behind jumps to latest page first then backfills older gaps silently•
b6c2a visited-chat-open [2]: < 1 page behind shows cached messages immediately and catches up with one after= read•
b6c2a visited-chat-open [3] & [4]: already offline and goes-offline mid-wait both fall back immediately to held entriesVerification & Revert-Falsification Gates (Linux x86_64 + macOS)
pionc fmt --check pion/client-core: passed (0diffs)pionc check --offline pion/client-core&pionc check --offline --target wasm32 pion/client-core:0diagnosticsnode pion/client-core/scripts/check-structure.mjs --self-test&check-structure.mjs:606production.pionfiles<= 1500lines (0inOVER),0debug_assert(,0self-referencing closure cellsgen-pion-shapes.mjs --check,gen-mermaid-widths.mjs --check,gen-math-font.mjs --check,gen-pion-i18n.mjs --check,i18n-words.ts --target pion-core: all passedwasm32Builds:packages/{sync,views,present,vault,passwords}all compiled cleanlypion/client-coreSuites:pionc test --offline pion/client-core(debug):2217 / 2217passed (0failed)pionc test --offline --release pion/client-core:2217 / 2217passed (0failed) (sync --release:1805 / 1805passed)pionc test --offline --release pion/client-core/packages/core_runtime:334 / 334passed (0failed)pnpmNode Gates:core_secure_posix_test:okparity-b6c1-sync.test.mjs,schema-chat-tag.test.mjs,core-perf-gate.test.mjs,parity-b6d2-budgets.test.mjs(46 / 46),parity-b6e3-views.test.mjs:0failures1a-thread-after-edit(thread_after.pionif text_changedmutated) -> failsb6c2a thread-after [1](FALSIFIED_OK)1b-sse-dup-skip(station_events_sse.pionn <= existing_lastduplicate skip disabled) -> failsb6c2a thread-after [4](FALSIFIED_OK)2-read-recovery(cc_read_recovery.pionmarks_loadedgate disabled) -> failsb6c2a read-recovery(FALSIFIED_OK)3-chat-open-sync(cc_chat_open_sync.pionprepare_chat_open_syncbypassed) -> failsb6c2a chat-reconnect / visited-chat-open(FALSIFIED_OK)4-sql-replay-and-lock-hurry(station_events_stream.pionsql_failed_in_streamreplay disabled) -> failsb6c2a reconnect-recovery [1]-[3](FALSIFIED_OK)5-cloud-socket-idle-deadline(cloud_api.pionCLOUD_SOCKET_IDLE_MSmutated60s -> 6000s) -> failsb6c2a reconnect-recovery [9](FALSIFIED_OK)R2 Review Closure (
b6c2a_r2_review_test.pion&b6c2a_burst_lock_syncing_test.pion)cc_chat_open_sync.pion,cc_gates.pion): Per-line(account_epoch, authGen, station_read_open, slot_id, req_gen)fence in cold/batchNDJSON stream interrupting stale streams before writing to SQLite, plus guaranteedcold_reqrelease on completion so transient auth/read-gate transitions never deadlock onWaiting.cc_chat_open_sync.pion): Removed globalchat_open_sync.epochbump indrop_stations; isolated eachChatOpenSlotand request by(account_epoch, slot_id, req_gen)across callbacks,on_drop, and retry timers.cc_chat_attend.pion,cc_focus_windows.pion): Per-windowchat_end/chat_end_seq/chat_seentracking onFocusWindowand view-bounded auto-read (shown_newest/shortfrom renderedChatView, never DBchat_latest).cc_read_recovery.pion,cc_calls_chat.pion,cc_wire.pion): Offline guard leavesheld_readsandattend_sentclean; failedPUTpreserves higherqueued_target(max(confirmed, held)); stale(account_epoch, auth_gen)callbacks return immediately without mutatingread_recovery; publicchat.readawaitsPUT /threads/:id/read, adopts station-returnedn, and surfaces failures.cc_chat_open_sync.pion): Hoistedslot.openedfast path ahead of SQL scans and bounded initial open tostore::log_max_n(O(1)refresh entry reads across100vs2,000held entries).thread_after.pion,cc_chat_attend.pion,cc_chat_subs.pion,cc_chat_open_sync.pion,hub_wire_station.pion,b6c2a_burst_lock_syncing_test.pion):thread_afterreturnsNoneon emptysaid;live_seqsbounded strictly to open chat slots and evicted to0on unsubscribe; multi-chunk whole-JSON/batchaccepted up tomesh::max_body(16 MiB); HTTP426body preserved onHubWrappedStation::events_k; addedbumpWorkspaceauthGenbump burst-yield test ([3b]).Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.