You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "chihumyum (via GitHub)" <gi...@apache.org> on 2026/10/06 16:52:26 UTC

[PR] fix(desktop): restore transcript Retry after initial load failures [maka]

chihumyum opened a new pull request, #5974:
URL: https://github.com/apache/maka/pull/5974

   ## Summary
   
   When the first transcript read and its automatic recovery both fail, Retry does nothing because it can only reach a controller after a successful publication. Keep the current observation controller available to Retry so the next read restores the conversation. Check session selection and observation identity to reject stale commands and errors.
   
   This covers transcript Retry only. Published-history readiness and the observation effect's cleanup ownership remain intact.
   
   ## Verification
   
   - The reader regression failed before the fix with `Retry must issue another transcript read before any publication: 2 !== 3`. The 10 new regression cases now pass, and 153 related conversation, transcript, and navigation tests pass through `node --test`.
   - `npm run build`, `npm run typecheck`, `npm run lint`, `npm run format:check`, and Knip for desktop and UI pass. Renderer architecture against the base, Astryx surface inventory, Windows inventory, app-shell hooks, E2E budget, and ASF headers pass.
   - Actual Electron window with this build and isolated fixture data: injected initial and automatic read failures, clicked the visible Retry button, and verified the transcript returned and Retry disappeared. Used the existing preload E2E latch, without a real account. The full cross-platform suite was not run locally.
   
   ## AI use
   
   - [ ] No generative tool made a substantive contribution
   - [x] Generative tooling made a substantive contribution
   
   Tool(s) and scope: Codex with GPT-6 Astra for investigation, implementation, regression tests, review, and verification. Both commits include `Generated-by: Codex`.
   
   ## Checklist
   
   - [x] Tests cover the change and fail without it
   - [x] Lint, format, typecheck and the affected suites pass locally
   
   Does this PR entail a change in behavior?
   
   - [x] Yes — described under Summary above
   - [ ] No
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): restore transcript Retry after initial load failures [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han merged PR #5974:
URL: https://github.com/apache/maka/pull/5974


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): restore transcript Retry after initial load failures [maka]

Posted by "chihumyum (via GitHub)" <gi...@apache.org>.
chihumyum commented on code in PR #5974:
URL: https://github.com/apache/maka/pull/5974#discussion_r4213482363


##########
apps/desktop/src/renderer/features/conversation/model/transcript-commands.ts:
##########
@@ -51,10 +51,11 @@ export function createTranscriptCommands(workspace: ConversationWorkspace, feedb
       }
     },
     async retryMessages(sessionId: string) {
-      if (activeIdRef.current !== sessionId || !ui.messageRetryPending.claim(sessionId)) return;
-      const controller = transcriptRangeRef.current;
-      try { await controller?.reload(); }
-      catch (error) { if (activeIdRef.current === sessionId && transcriptRangeRef.current === controller) reportError(sessionId, error); }
+      const observation = observationRef.current;
+      if (!observation || observation.sessionId !== sessionId || !workspace.commands.isSessionSelected(sessionId)
+        || !ui.messageRetryPending.claim(sessionId)) return;
+      try { await observation.controller.reload(); }
+      catch (error) { if (observationRef.current === observation && workspace.commands.isSessionSelected(sessionId)) reportError(sessionId, error); }

Review Comment:
   Fixed in d168c626d: retryMessages no longer reports, because reload() already reports through onError. A failed Retry now raises one 'Failed to load task' toast and keeps the original load error; the test asserts that toast, and none on a later successful Retry.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): restore transcript Retry after initial load failures [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #5974:
URL: https://github.com/apache/maka/pull/5974#discussion_r4198324037


##########
apps/desktop/src/renderer/features/conversation/model/transcript-commands.ts:
##########
@@ -51,10 +51,11 @@ export function createTranscriptCommands(workspace: ConversationWorkspace, feedb
       }
     },
     async retryMessages(sessionId: string) {
-      if (activeIdRef.current !== sessionId || !ui.messageRetryPending.claim(sessionId)) return;
-      const controller = transcriptRangeRef.current;
-      try { await controller?.reload(); }
-      catch (error) { if (activeIdRef.current === sessionId && transcriptRangeRef.current === controller) reportError(sessionId, error); }
+      const observation = observationRef.current;
+      if (!observation || observation.sessionId !== sessionId || !workspace.commands.isSessionSelected(sessionId)
+        || !ui.messageRetryPending.claim(sessionId)) return;
+      try { await observation.controller.reload(); }
+      catch (error) { if (observationRef.current === observation && workspace.commands.isSessionSelected(sessionId)) reportError(sessionId, error); }

Review Comment:
   P3: a failed Retry shows two error toasts. `controller.reload()` (`desktop-transcript-range-store.ts:205-208`) calls `recovery.transcriptFailed(error)` and then rethrows. `transcriptFailed` goes to `options.onError`, which runs `applyReadError`, which toasts `messageReadFailedTitle`. The rethrow lands here and `reportError` toasts `transcriptRefreshTitle` with the same session. The `{ sessionId }` argument is a diagnostic target, not a dedup key. The second message also overwrites the first in `messageLoadErrorBySession`. The published path already behaved this way, but this PR makes it reachable from the initial-failure state, where users are most likely to retry repeatedly. Consider leaving the toast to `onError` here and only clearing `messageRetryPending`, or have `reload` report through one channel only. A toast-count assertion in the 'failed Retry then successful Retry' case would pin it down.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): restore transcript Retry after initial load failures [maka]

Posted by "Astro-Han (via GitHub)" <gi...@apache.org>.
Astro-Han commented on code in PR #5974:
URL: https://github.com/apache/maka/pull/5974#discussion_r4213605902


##########
apps/desktop/src/renderer/features/conversation/model/transcript-commands.ts:
##########
@@ -51,10 +51,12 @@ export function createTranscriptCommands(workspace: ConversationWorkspace, feedb
       }
     },
     async retryMessages(sessionId: string) {
-      if (activeIdRef.current !== sessionId || !ui.messageRetryPending.claim(sessionId)) return;
-      const controller = transcriptRangeRef.current;
-      try { await controller?.reload(); }
-      catch (error) { if (activeIdRef.current === sessionId && transcriptRangeRef.current === controller) reportError(sessionId, error); }
+      const observation = observationRef.current;
+      if (!observation || observation.sessionId !== sessionId || !workspace.commands.isSessionSelected(sessionId)
+        || !ui.messageRetryPending.claim(sessionId)) return;
+      // The controller reports a failed reload through the observation's onError, as for its own reloads.
+      try { await observation.controller.reload(); }
+      catch { /* already reported */ }

Review Comment:
   P3 (low): "already reported" holds except while the range is showing a cached snapshot.
   - `desktop-transcript-range-store.ts:199-202` only forwards to `onError` when `!cached()`.
   - In that state the reopen fails, with `requireLive` reporting "waiting for Host reconnection" or the open itself failing, so `transcriptFailed` reports nothing.
   - Before this commit, the catch here raised a `transcriptRefreshTitle` toast.
   - Now a Retry clicked while a cached transcript is shown with a load error, for example one set by `refreshMessages`, clears the pending flag with no feedback.
   
   If that silence is intended, while the cached view waits for reconnection, please say so in this comment. Otherwise report here only when the controller is holding a cached snapshot.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org


Re: [PR] fix(desktop): restore transcript Retry after initial load failures [maka]

Posted by "chihumyum (via GitHub)" <gi...@apache.org>.
chihumyum commented on code in PR #5974:
URL: https://github.com/apache/maka/pull/5974#discussion_r4213630246


##########
apps/desktop/src/renderer/features/conversation/model/transcript-commands.ts:
##########
@@ -51,10 +51,12 @@ export function createTranscriptCommands(workspace: ConversationWorkspace, feedb
       }
     },
     async retryMessages(sessionId: string) {
-      if (activeIdRef.current !== sessionId || !ui.messageRetryPending.claim(sessionId)) return;
-      const controller = transcriptRangeRef.current;
-      try { await controller?.reload(); }
-      catch (error) { if (activeIdRef.current === sessionId && transcriptRangeRef.current === controller) reportError(sessionId, error); }
+      const observation = observationRef.current;
+      if (!observation || observation.sessionId !== sessionId || !workspace.commands.isSessionSelected(sessionId)
+        || !ui.messageRetryPending.claim(sessionId)) return;
+      // The controller reports a failed reload through the observation's onError, as for its own reloads.
+      try { await observation.controller.reload(); }
+      catch { /* already reported */ }

Review Comment:
   Fixed in 99f2df61a: the controller exposes holdsCachedTranscript() (its existing cached check), and a failed Retry over the cached transcript now reports a refresh error itself, under the old stale guard. Other failures still report once via onError. The test pins one refresh toast in the cached case.
   
   _🤖 Addressed by [Claude Code](https://claude.com/claude-code)_



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org