Skip to content

Sentry Ios Lazy Load - #1660

Merged
swu-rob[bot] merged 6 commits into
mainfrom
claude/sentry-ios-lazy-load
Nov 11, 2026
Merged

swu-rob[bot] merged 6 commits into
mainfrom
claude/sentry-ios-lazy-load

Conversation

@jaywedgeworth22

@jaywedgeworth22 jaywedgeworth22 commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

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 new Session.loadInitialMessages(threadId:), called from ChatView, 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.testStubHydrateDoesNotWipeAnAlreadyLoadedThread to 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:

  • [high] ios/App/Session.swift:768 — one-message hydrate hides non-newest pending approval cards.
  • [high] ios/App/Session.swift:1517 — initial-page skip leaves reconnect gap unrepaired on loaded threads.
  • [medium] ios/App/Session.swift:1519 — loadInitialMessages skips fetch when hasMore is missing.

jaywedgeworth22 and others added 2 commits September 25, 2026 01:28
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>
@github-actions github-actions Bot added the ui Touches UI or UX: wakes BF-Designer label Nov 9, 2026
@swu-rob
swu-rob Bot marked this pull request as ready for review November 9, 2026 05:44
Comment thread ios/App/Session.swift Resolved
@swu-gb-designer

Copy link
Copy Markdown
Contributor

[GB-DESIGNER 📁BotFleet]

UI pass on iOS lazy transcript loading, tip e1976dfa14: approve with UX nits.

  • Opening a chat now shows a one-message stub, then the rest of the page lands.  Please check that the transcript stays pinned to the newest message when the page merges, so nothing jumps under the reader's thumb.
  • If the fetch takes a moment on a slow connection, a small loading row above the stub would read better than a near-empty chat.  On failure the chat just stays at one message, so the action-error banner should name it in plain words, for example "Couldn't load earlier messages."
  • The branch is far behind main, so the follow-at-bottom work on main should be retested after a rebase.

Not runtime-verified.

@jaywedgeworth22

Copy link
Copy Markdown
Member Author

@kody start-review

@kody-ai

kody-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Completed! 🔥

The code review was successfully completed based on your current configurations.

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

Automatic approval held: The review is not clean.

Comment thread ios/App/Session.swift Resolved
Comment thread ios/App/Session.swift Resolved
Comment thread ios/App/Session.swift Resolved
@kody-ai

kody-ai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Automatic approval held

Kody's assessment:

Draft perf change cuts launch hydrate from 50 to 1 message and defers full load to ChatView open, relying on merge behavior not shown in diff; iOS areas have prior bug-fix history.

jaywedgeworth22 and others added 4 commits November 10, 2026 18:30
…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.

@swu-rob swu-rob Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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.

@swu-rob
swu-rob Bot merged commit 04a10d0 into main Nov 11, 2026
37 checks passed
@swu-rob
swu-rob Bot deleted the claude/sentry-ios-lazy-load branch November 11, 2026 02:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ui Touches UI or UX: wakes BF-Designer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant