Skip to content

Handle document-read errors (e.g., Google Docs authorization timeout) - #585

Open
kcarnold wants to merge 1 commit into
mainfrom
fix/handle-doc-context-read-errors
Open

Handle document-read errors (e.g., Google Docs authorization timeout)#585
kcarnold wants to merge 1 commit into
mainfrom
fix/handle-doc-context-read-errors

Conversation

@kcarnold

Copy link
Copy Markdown
Contributor

The change on Draft may not be correct:

One real bug — draft's Retry re-runs the wrong request. frontend/src/pages/draft/index.tsx:454 sets the error via updateErrorInfo directly, outside getSuggestion, so lastRequestRef.current (set at :319) is never updated. For a non-auth ScriptError the notice is retryable: true, so a Retry button appears — and retryLastRequest (:377) re-runs whatever request last succeeded, with its stale docContext. Concretely: writer runs "Questions" on their intro, keeps writing for ten minutes, clicks a feature, the bridge hiccups, they hit Retry — and get a fresh-looking suggestion generated from the document as it was ten minutes ago. If there was no earlier request it silently does nothing. Revise gets this right (retryVisualization re-enters requestVisualization from the top, :503) and chat gets it right (Retry re-enters submitMessage, which redoes the read); draft is the odd one out. Cheapest fix is to have the catch stash the intended mode so Retry re-enters requestSuggestion(mode).

But maybe we just drop the retry functionality entirely; an error of any kind shouldn't end up in the history.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant