fix(web): thread error banner dismiss survives reconnect and rerenders #6123
Mergedmyacoub91(GitHub profile, opens in a new tab)merged 3 commits into
main fromrefs/pull/6123/headmerged by maria-rcks View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:M
- apps/web/src/components/ChatView.tsx line 1512OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -1493,3 +1497,16 @@14931497 const threadError = isServerThread14941498 ? (localServerError ?? activeServerThread?.session?.lastError ?? null)14951499 : localDraftError;1500+ // Dismissals can only mask the shown error, never clear it: a server thread1501+ // keeps its error in session.lastError, so clearing the local shadow would1502+ // just fall through to the persisted one. Mask the current error until a1503+ // different error arrives, mirroring the provider status banner.1504+ const threadErrorBannerKey = getThreadErrorBannerKey(routeThreadKey, threadError);1505+ const [dismissedThreadErrorBannerKey, setDismissedThreadErrorBannerKey] = useState<string | null>(1506+ null,1507+ );1508+ useEffect(() => {1509+ if (threadError === null && dismissedThreadErrorBannerKey !== null) {1510+ setDismissedThreadErrorBannerKey(null);1511+ }1512+ }, [dismissedThreadErrorBannerKey, threadError]);
- apps/web/src/components/ChatView.tsx line 6176Resolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -6146,5 +6164,7 @@61466164 </header>6147616561486166 <ThreadErrorBanner6149- error={threadError}6150- onDismiss={() => setThreadError(activeThread.id, null)}6167+ error={visibleThreadError}6168+ onDismiss={() => {6169+ setThreadError(activeThread.id, null);6170+ dismissThreadErrorBannerForSession(threadErrorBannerKey);
macroscopeapp[bot](GitHub profile, opens in a new tab) approved these changes
maria-rcks merged this57b1052
maria-rcks closed this
Sign in to join this conversation.


Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro Plus
Run ID:
cf046364-a782-4ab0-9c98-e3b7384e4f82You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share