Skip to content

fix(content): make sitemap/RSS/llms trigger chain observable and auth-explicit - #28

Merged
gogrowth-co merged 1 commit into
mainfrom
fix/sitemap-trigger-chain
Aug 14, 2026
Merged

fix(content): make sitemap/RSS/llms trigger chain observable and auth-explicit#28
gogrowth-co merged 1 commit into
mainfrom
fix/sitemap-trigger-chain

Conversation

@gogrowth-co

@gogrowth-co gogrowth-co commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Root cause

The sitemap, RSS, and llms.txt in Supabase Storage have been frozen since 2026-07-09 20:04Z (verified via storage last-modified headers). The live sitemap is missing hyperliquid-analysis, still emits pre-rename slugs, and Google never saw Arena #1.

supabase.functions.invoke reports failure via its return value, not an exception — so every try { invoke } catch (_) {} call site swallowed the failures invisibly, and upsert_page even reported sitemap as triggered on failure. The chain broke at the 2026-07-09 redeploy of mcp-content (the unpinned esm.sh/@supabase/supabase-js@2 import re-resolves on every deploy).

Fix

  • Sibling functions are now called via explicit fetch with explicit service-role Authorization + apikey headers — independent of library auth defaults.
  • supabase-js pinned to 2.58.0.
  • Per-trigger success/failure surfaced in the tool response (triggers[]) for both upsert_page and delete_page, and logged via console.error on failure.

Verification plan (post-deploy)

Call delete_page on a throwaway draft — the response now includes triggers; then confirm storage last-modified advances and the live sitemap contains hyperliquid-analysis.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved reliability of content regeneration after page updates and deletions.
    • Regeneration failures are now reported instead of being silently ignored.
    • Added clearer success or failure feedback for content management operations.

…-explicit

supabase-js functions.invoke reports failure via return value, not exception,
so the try/catch-swallow pattern hid every failure. The whole regeneration
chain (sitemap, RSS, llms.txt, snapshot, IndexNow) has been silently dead
since the 2026-07-09 redeploy: storage artifacts frozen at Jul 9 20:04Z,
sitemap missing hyperliquid-analysis and emitting pre-rename slugs.

- call sibling functions via explicit fetch with explicit service-role
  Authorization (independent of library auth defaults)
- pin supabase-js import to 2.58.0 (unpinned @2 re-resolves on every deploy)
- surface per-trigger success/failure in the tool response (triggers[])
  for upsert_page and delete_page instead of pretending success

Co-Authored-By: Claude Fable 5 <[email protected]>
@netlify

netlify Bot commented Aug 14, 2026

Copy link
Copy Markdown

Deploy Preview for mangabeira ready!

Name Link
🔨 Latest commit e5ff3e6
🔍 Latest deploy log https://app.netlify.com/projects/mangabeira/deploys/6a7e5fc6b00a46000954f03b
😎 Deploy Preview https://deploy-preview-28--mangabeira.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@gogrowth-co
gogrowth-co merged commit 68d9fa5 into main Aug 14, 2026
4 of 7 checks passed
@gogrowth-co
gogrowth-co deleted the fix/sitemap-trigger-chain branch August 14, 2026 00:22
@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: gogrowth-co/coderabbit/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 6307f681-5de1-4802-9375-b245894fb1c5

📥 Commits

Reviewing files that changed from the base of the PR and between 0cdcd60 and e5ff3e6.

📒 Files selected for processing (1)
  • supabase/functions/mcp-content/index.ts

📝 Walkthrough

Walkthrough

The MCP content function now uses authenticated POST requests to trigger regeneration Edge Functions. Page upsert and deletion responses include trigger success or failure statuses.

Changes

Content regeneration

Layer / File(s) Summary
Authenticated trigger helper
supabase/functions/mcp-content/index.ts
Pins Supabase JS to 2.58.0 and adds triggerFn for authenticated POST requests, failure logging, and status strings.
Regeneration workflow integration
supabase/functions/mcp-content/index.ts
Page upsert and deletion workflows use triggerFn and return its results. Published-status conditions remain for upsert regeneration.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MCPCaller
  participant mcp-content
  participant triggerFn
  participant EdgeFunction

  MCPCaller->>mcp-content: Upsert or delete page
  mcp-content->>triggerFn: Trigger regeneration
  triggerFn->>EdgeFunction: Authenticated POST request
  EdgeFunction-->>triggerFn: HTTP response
  triggerFn-->>mcp-content: Success or failure status
  mcp-content-->>MCPCaller: Response with trigger results
Loading
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/sitemap-trigger-chain

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

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

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.

2 participants