Repository navigation
Sentry Ios Lazy Load - #1660
Sentry Ios Lazy Load#1660
Conversation
Co-authored-by: sentry[bot] <39604003+sentry[bot]@users.noreply.github.com>
Review on the Seer autofix (#609) flagged that hydrateSnapshot() now always fetching a one-message stub (fleet(messages: 1)) would, on a mid-session hydrate, collapse a chat the person already scrolled back 50 messages into down to that stub, since ChatView's .task(id:) does not re-run on the wipe. That was true against the base #609 was opened against, but #614 (merged afterward) changed Store.hydrate to merge each thread's fresh page by id instead of replacing it, specifically to stop a re-hydrate from discarding scrollback already paged in (IO12). A stub hydrate merging a single message is the same code path, so the wipe #609's review described can no longer happen. This adds a StoreTests case that reproduces the exact review scenario (load 50, then hydrate with a 1-message stub) and proves the thread survives intact. Supersedes #609 (no production code change needed beyond #609's own commit; this rebases it onto main with #614 already in place and adds regression coverage for the interaction). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
[GB-DESIGNER 📁BotFleet] UI pass on iOS lazy transcript loading, tip
Not runtime-verified. |
|
@kody start-review |
Code Review Completed! 🔥The code review was successfully completed based on your current configurations. Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
Automatic approval held: The review is not clean. |
|
Automatic approval held Kody's assessment:
|
…tub backfill for pending approvals Review on #1660: the count>=50 skip left a permanent hole after a reconnect stub merge (loadOlder only pages backward), and a missing hasMore entry skipped the fetch forever. The open-fetch is now unconditional; merge dedupes by id. backfillStubThreads loads first pages for stub threads so pendingApprovals sees non-tip cards.
There was a problem hiding this comment.
[MA] All four review findings fixed in 73ba55a/9dc82a08/0ab23f21 (unconditional open fetch + live-session stub backfill + regression test); all 18 checks green on the final head, including the full iOS Swift suite and unsigned build. Merging under the fleet completion pass.
Summary
Launch hydration now fetches only a one-message preview per thread (
fleet(messages: 1)instead of 50) to avoid blocking the main thread with bulk text layout at launch. Opening a chat now defers the full transcript cost via newSession.loadInitialMessages(threadId:), called fromChatView, which fetches the newest 50 messages and merges by message id. Code comments link this stub-hydration approach to #609 and hydrate merge behavior to #614.User-visible / operational impact
Launch does less upfront message layout work across bots, with the complete initial page loaded the first time a thread is opened. The preview stub remains visible until the merged full page populates the transcript before scrolling.
Tests
Adds
StoreTests.testStubHydrateDoesNotWipeAnAlreadyLoadedThreadto verify a one-message stub hydrate merges into, rather than replacing, an already-loaded thread. No test execution results are included in the changes, so pass/fail remains unverified.Open review findings
Automated review reported 3 findings, carried here as unresolved risks rather than resolved findings:
ios/App/Session.swift:768— one-message hydrate hides non-newest pending approval cards.ios/App/Session.swift:1517— initial-page skip leaves reconnect gap unrepaired on loaded threads.ios/App/Session.swift:1519—loadInitialMessagesskips fetch whenhasMoreis missing.