Repository navigation
fix(home): reload Home when the app returns after a load was cut off - #752
Conversation
A Home load that was cut off when the app was suspended, or that failed while a push woke the app in the background, left Home showing its full-screen offline error. On iPhone and Mac nothing loaded Home again when the app came back, because Home stays on screen while the app is away and only loads when it appears. The error stayed up until the person tapped Retry. Home now knows when the app is in the background. A load that fails there keeps the loading placeholder instead of the error, and Home loads again as the app returns. A load that ended in an error while the app was open is also retried on return. Apple TV already reloaded Home on return; it now also skips showing a failure from the background. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No actionable issue remains under the stated Home reload behavior. The change is mergeable after normal checks. Pre-merge checks ·
|
|
The Evidence section covers iPhone, but the Approach also changes Home recovery on iPad and Mac and background-error handling on Apple TV. Please add before-and-after Home captures for those affected surfaces, plus a short background/return recording to show automatic recovery without tapping Try Again, as CONTRIBUTING.md requires for timing-dependent changes. If a surface cannot be captured, state the limitation for the maintainer to assess. AI disclosure: Silo Triage using OpenClaw, model |
Home could still show the offline error after the app came back. If a load was in flight when the app left, suspension could cut its request off, and the failure arrived only after the app returned. The return check had already run and found nothing to retry, so the late failure put the error up. Home now notes when a load is in flight while the app is in the background. On return it starts a new load that replaces that one, with a fresh request instead of joining the cut-off one. A replaced load's late result or failure is ignored, so it cannot put up an error or overwrite newer rows. The transient retry checks again after its wait and, if the app has left, waits for the return instead of sending a request. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
The evidence page now covers the other surfaces, on the fixed build (740ea14):
|
Problem
Related issue: N/A
Validation tasks: none
On iPhone, Home can come back from the background showing the full-screen "Can't reach the server" error even though the server is fine. It happens when a Home load starts as the app goes to the background and is cut off by suspension, or fails while a push wakes the app in the background. Home stays on screen while the app is away and only loads when it appears, so nothing loads it again. The error stays until the person taps Try Again. It showed up on a real iPhone while testing push notifications: tapping a notification brought the app back to this error, and Try Again loaded Home immediately.
This change hides failures that happen in the background, and makes Home reload when the app returns.
Approach
HomeViewpasses the scene phase toHomeViewModel. A Home load that fails while the app is in the background keeps the loading placeholder instead of setting the error, and skips its quick retry. Home then loads again when the app becomes active, so the error never flashes.Validation
HomeSectionsMutationTests(three new tests),PersonalStateSyncTests,ApplePushNotificationSyncTestsandApplePushRegistrationTests. Each new test fails with its part of the fix undone. The cut-off-load test fails on the previous head: two fetches instead of three, and the error shown.main, Home came back showing the error and made no new request. With this change it reloaded by itself.main, the error showed for about a second before the existing return refresh replaced it. With this change no error frame appears.Evidence
Evidence: https://evidence.siloserver.org/r/silo-apple/pr-752/
Surface and build: Home on iPhone and iPad (iOS 27.0 simulators) and Apple TV (tvOS 27.0 simulator), with before and after captures and recordings. Builds:
main(860bb6f) before and this branch (740ea14) after. Mac was not captured; the evidence page explains why.Risks
Checklist
AI Disclosure
🤖 Generated with Claude Code