fix: self-heal blank screen after tab switch / iCloud sync#89
Closed
devin-ai-integration[bot] wants to merge 1 commit into
Closed
fix: self-heal blank screen after tab switch / iCloud sync#89devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Fix A: MessagingVC subscribes to .conversationStoreDidChange so it re-reads the current conversation when pass-2 hydration or iCloud sync delivers new messages. Guarded against clobbering in-flight agent turns (ai_state, streaming partial). Fix D: Add messagesDidReload() hook called at the end of every loadMessagesFromConversation path. MainVC overrides it to call refreshAvatarVisibility(), ensuring the hero orb collapses on every message- load path — not just loadConversation and newMessageSent. Quick wins: - Prioritize the active conversation in pass-2 hydration queue so the user doesn't stare at a blank screen while other conversations hydrate first. - Defensive empty-state guard: if the store returns 0 messages for a not-yet- hydrated conversation, defer render and request async hydration instead of clearing the screen. - Eviction tolerance in surgicalRefresh: use a mark-for-eviction set so cache entries aren't evicted on the first miss (protects against transient iCloud file rename/download operations). Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
Original prompt from API User
|
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Implements the fixes from the investigation in #88 to cure the blank-screen / stale-orb bug after tab-switch + iCloud sync.
Root cause recap:
MessagingVCnever observed.conversationStoreDidChange, so when pass-2 hydration (or iCloudsurgicalRefresh) delivered messages after the UI had already loaded an empty stub, the screen stayed blank. Separately, theloadLastConversation → loadMessagesFromConversationpath bypassedMainVC.loadConversation, sorefreshAvatarVisibility()never ran — hero orb stayed visible even with messages present.Changes
Fix A —
MessagingVCself-heals on store changes:Fix D —
messagesDidReload()hook:Quick wins in
ConversationFileStore:prioritizeHydration(id:)— moves the active conversation to the front of the pass-2 hydration queue. Called fromloadLastConversation.isHydrated(id:)/requestHydrationIfNeeded(id:)— public queries used by the defensive guard inloadMessagesFromConversation: if the store returns 0 messages for a not-yet-hydrated conversation, defer render instead of clearing the screen.surgicalRefresh: apendingEvictions: Set<String>stages missing IDs on the first pass; actual eviction only happens if the file is still missing on the next refresh — prevents transient iCloud download/rename from evicting the active conversation."Link to Devin session: https://app.devin.ai/sessions/764ee807e9284b4998911008069229b9