Skip to content

Report a failed Google Doc update instead of an empty success - #165

Merged
Programcode merged 1 commit into
mainfrom
cursor/gdoc-empty-export-791b
Oct 22, 2026
Merged

Programcode merged 1 commit into
mainfrom
cursor/gdoc-empty-export-791b

Conversation

@Programcode

Copy link
Copy Markdown
Owner

Export could create the Google Doc and then fail to write the body. The function still returned HTTP 200 with success: true, so the app opened a blank document and treated the export as done.

I found the fall-through after batchUpdate in supabase/functions/export-gdoc/index.ts. The client already treats any non-OK response as a failure and shows error, so the function now returns 502 with a fixed message and DOCUMENT_UPDATE_FAILED when the content update fails. The empty file still exists in Drive; the response includes its URL, and the app no longer claims success. An update Google accepts still returns the document.

No client or layout change.

Verified locally (GitHub Actions is out of minutes, so this is not a CI pass):

  • deno test supabase/functions/export-gdoc/auth_test.ts (6 passed), including a failed batch update and a successful one

Not run: a real Google Docs export. That needs a Google token and was not attempted.

Open in Web Open in Cursor 

Creating the document and then failing to write its content still returned
200 with success true, so the app opened a blank file. A failed batch update
now returns 502 with the document link and a fixed error.

Co-authored-by: Gáborjáni-Szabó Ádám <Programcode@users.noreply.github.com>
@vercel

vercel Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
debate-navigator Ready Ready Preview Oct 22, 2026 11:20am UTC
debatelab-staging Ready Ready Preview Oct 22, 2026 11:20am UTC

@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 51 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between 4f9e0a0 and 22cdbf3.

📒 Files selected for processing: 2
  • supabase/functions/export-gdoc/auth_test.ts
  • supabase/functions/export-gdoc/index.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Essentials by visiting https://app.coderabbit.ai/settings/billing.

Comment @coderabbitai help to get the list of available commands.

@Programcode
Programcode marked this pull request as ready for review October 22, 2026 12:24
Copilot AI balanced review requested due to automatic review settings October 22, 2026 12:24
@Programcode
Programcode merged commit 135f4de into main Oct 22, 2026
7 of 17 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch was successfully deployed

2 active deployments
Preview – debatelab-staging — 22cdbf30 Deployed Oct 22, 2026 by vercel[bot]
Preview – debate-navigator — 22cdbf30 Deployed Oct 22, 2026 by vercel[bot]
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.

3 participants