Skip to content

fix: use throw instead of return for simpleError() calls#1416

Merged
riderx merged 5 commits into
mainfrom
riderx/fix-simpleError-throw
Jan 12, 2026
Merged

fix: use throw instead of return for simpleError() calls#1416
riderx merged 5 commits into
mainfrom
riderx/fix-simpleError-throw

Conversation

@riderx
Copy link
Copy Markdown
Member

@riderx riderx commented Jan 10, 2026

Summary

Fixed inconsistent error handling pattern where simpleError() calls were using return instead of throw. Since simpleError() returns never type (it throws HTTPException internally), all callers should use throw for correct error handling semantics.

Test plan

  • bun lint:backend passes with no errors
  • bun test:backend passes with 127 unit tests passing (integration tests require running backend)

Checklist

  • My code follows the code style of this project and passes bun run lint:backend
  • My change requires a change to the documentation
  • My change has adequate E2E test coverage
  • I have tested my code manually

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Improved internal error handling mechanisms across backend services by converting error propagation to use exception-based handling. Error codes and user-facing messages remain unchanged.

✏️ Tip: You can customize this high-level summary in your review settings.

simpleError() returns never type since it throws HTTPException internally,
so all callers should use throw instead of return for consistency and
correct error handling semantics. Updated 39 files across _backend to
use throw simpleError() instead of return simpleError().

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jan 10, 2026

Warning

Rate limit exceeded

@riderx has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 11 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between fcb84fd and da9d3af.

📒 Files selected for processing (5)
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/stripe_portal.ts
📝 Walkthrough

Walkthrough

This PR systematically converts error handling patterns across backend functions from returning simpleError responses to throwing them, shifting approximately 40 files from value-based error returns to exception-based control flow.

Changes

Cohort / File(s) Summary
File Handlers
supabase/functions/_backend/files/files.ts, supabase/functions/_backend/files/preview.ts
Changed error paths from return simpleError(...) to throw simpleError(...) in upload and preview handlers. Preview handler affected across 12 lines for errors including invalid subdomain, disabled preview, missing bundle, encryption checks, and file-not-found cases.
Private API - Auth & User
supabase/functions/_backend/private/accept_invitation.ts, supabase/functions/_backend/private/create_device.ts, supabase/functions/_backend/private/log_as.ts, supabase/functions/_backend/private/invite_new_user_to_org.ts
Converted error-return paths to throws in validation and authentication flows (invalid body, auth check, admin lookup, magic link generation, CAPTCHA validation, user invitation). Affects 20 total lines across 4 files.
Private API - Admin & Stats
supabase/functions/_backend/private/admin_stats.ts, supabase/functions/_backend/private/stats.ts, supabase/functions/_backend/private/latency.ts
Changed error handling from returns to throws for admin authorization checks, metric validation, and latency result retrieval (6 lines total).
Private API - Credits & Stripe
supabase/functions/_backend/private/credits.ts, supabase/functions/_backend/private/stripe_checkout.ts, supabase/functions/_backend/private/stripe_portal.ts
Converted error returns to throws across pricing fetch and Stripe validation paths (authorization, user/org lookup, customer\_id checks, permissions). Affects 14 lines.
Private API - Data Management
supabase/functions/_backend/private/delete_failed_version.ts, supabase/functions/_backend/private/devices.ts, supabase/functions/_backend/private/download_link.ts, supabase/functions/_backend/private/events.ts
Changed error handling for version deletion, app access denial, bundle/manifest retrieval, and org fetch failures from returns to throws (11 lines).
Private API - Utilities & Config
supabase/functions/_backend/private/set_org_email.ts, supabase/functions/_backend/private/store_top.ts, supabase/functions/_backend/private/upload_link.ts, supabase/functions/_backend/private/validate_password_compliance.ts
Converted error paths for org email updates, data retrieval, upload validation, and password compliance checks from returns to throws (12 lines).
Triggers - Cron & Sync
supabase/functions/_backend/triggers/credit_usage_alerts.ts, supabase/functions/_backend/triggers/cron_clear_versions.ts, supabase/functions/_backend/triggers/cron_email.ts, supabase/functions/_backend/triggers/cron_stat_app.ts, supabase/functions/_backend/triggers/cron_stat_org.ts, supabase/functions/_backend/triggers/cron_sync_sub.ts
Replaced error returns with throws across cron jobs for version clearing, email processing, app/org stats, and subscription syncing. Handles missing orgId, appId, validation failures, and incomplete data (28 lines total).
Triggers - Create & Update
supabase/functions/_backend/triggers/on_app_create.ts, supabase/functions/_backend/triggers/on_channel_update.ts, supabase/functions/_backend/triggers/on_deploy_history_create.ts, supabase/functions/_backend/triggers/on_manifest_create.ts, supabase/functions/_backend/triggers/on_organization_create.ts, supabase/functions/_backend/triggers/on_user_update.ts, supabase/functions/_backend/triggers/on_version_create.ts
Converted error handling in database triggers from returns to throws for missing record IDs, required fields (app\_id, s3\_path), and org lookups (9 lines).
Triggers - Event & Queue Processing
supabase/functions/_backend/triggers/queue_consumer.ts, supabase/functions/_backend/triggers/stripe_event.ts
Changed error returns to throws in queue read/processing and Stripe event handling for timeout errors, batch operations, message validation, and plan lookups (12 lines).
Utilities
supabase/functions/_backend/utils/hono.ts, supabase/functions/_backend/utils/hono_middleware_stripe.ts, supabase/functions/_backend/utils/plugin_parser.ts, supabase/functions/_backend/utils/supabase.ts
Converted error handling in validation, auth middleware, plugin parsing, and Supabase client initialization from returns to throws. Also added await next() call in Stripe middleware and default value initialization for plugin versions (17 lines total).

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Poem

🐰 Errors now soar on wings so high,
No more returns, just throws that fly!
Exception paths twist through the night,
Catching all mishaps in flight! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 38.10% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: converting return statements to throw statements for simpleError() calls throughout the codebase.
Description check ✅ Passed The description includes a clear Summary explaining the rationale, a Test plan with specific test commands and results, and a completed Checklist with manual testing confirmation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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 and usage tips.

riderx and others added 3 commits January 12, 2026 13:50
simpleError() returns never type since it throws HTTPException internally,
so all callers should use throw instead of return for consistency and
correct error handling semantics. Updated 39 files across _backend to
use throw simpleError() instead of return simpleError().

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@riderx riderx force-pushed the riderx/fix-simpleError-throw branch from 7fbefb4 to b729662 Compare January 12, 2026 12:51
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
supabase/functions/_backend/triggers/cron_email.ts (1)

78-90: Bug: getFunComparison() uses ?? where || (and dynamic last-index) is intended.
As written, stats above the max threshold will likely produce index === -1 and throw at Line 88.

Proposed fix
 function getFunComparison(comparison: keyof typeof funComparisons, stat: number): string {
   const thresholdsForComparisons = thresholds[comparison]
+  const lastIndex = thresholdsForComparisons.length - 1
   const index = thresholdsForComparisons.findIndex((threshold, index) => {
     const thresholdGreaterThenStat = threshold >= stat
-    const lastIndexAndStatGreaterOrEqualThreshold = index === 2 && stat >= threshold
+    const lastIndexAndStatGreaterOrEqualThreshold = index === lastIndex && stat >= threshold
 
-    return thresholdGreaterThenStat ?? lastIndexAndStatGreaterOrEqualThreshold
+    return thresholdGreaterThenStat || lastIndexAndStatGreaterOrEqualThreshold
   })
 
   if (index === -1 || index >= 3)
     throw new Error(`Cannot find index for fun comparison, ${index}`)
 
   return funComparisons[comparison][index]
 }
supabase/functions/_backend/utils/plugin_parser.ts (1)

57-59: Redundant condition in version_name normalization.

The check !body.version_name on line 58 is always false because it's inside the if (body.version_name) block. Only body.version_name === 'builtin' can ever be true here.

Proposed fix
   if (body.version_name) {
-    body.version_name = (body.version_name === 'builtin' || !body.version_name) ? body.version_build : body.version_name
+    body.version_name = body.version_name === 'builtin' ? body.version_build : body.version_name
   }
🤖 Fix all issues with AI agents
In @supabase/functions/_backend/private/download_link.ts:
- Around line 32-33: The thrown error uses the wrong error code string; update
the simpleError call so the error code is "not_authorized" instead of
"not_authorize" in the conditional that checks (error || !auth?.user?.id) —
locate the throw simpleError('not_authorize', 'Not authorize') and change the
first argument to 'not_authorized' while leaving the message intact.
🧹 Nitpick comments (11)
supabase/functions/_backend/utils/hono_middleware_stripe.ts (1)

24-42: Middleware now correctly short-circuits on validation errors and continues the chain via await next().
Good alignment with the “exception-based” error flow, and adding await next() prevents silently stopping the pipeline on success. As per coding guidelines/learnings, the structured logging with requestId: c.get('requestId') is consistent.

Minor: the second env check at Line 27 duplicates the first one; consider dropping the repeated getEnv(...) conditions to reduce noise.

supabase/functions/_backend/private/store_top.ts (1)

19-21: throw simpleError(...) on missing data is consistent with the new flow.
Optional: include { mode } (and/or upstream errors if available) in moreInfo to make this actionable when it fires.

supabase/functions/_backend/private/latency.ts (1)

9-17: Good: switch to throw simpleError(...) for correct control flow.

This matches simpleError(...): never semantics and avoids “error-as-return-value” ambiguity.

Suggested resilience tweak (ensure pg client always closes)
 app.get('/', async (c) => {
   cloudlog({ requestId: c.get('requestId'), message: 'Latency check' })
   const pgClient = getPgClient(c, true)
-  const res = await selectOne(pgClient)
-
-  await closeClient(c, pgClient)
-  if (!res)
-    throw simpleError('cannot_get_apps', 'Cannot get apps')
+  try {
+    const res = await selectOne(pgClient)
+    if (!res)
+      throw simpleError('cannot_get_apps', 'Cannot get apps')
+  }
+  finally {
+    await closeClient(c, pgClient)
+  }
   return c.json(BRES)
 })
supabase/functions/_backend/private/set_org_email.ts (1)

21-25: Throw conversions look correct; consider reducing echoed request body in invalid_json_body.

The throw simpleError(...) updates align with simpleError(...): never. For invalid_json_body, including the raw body in the error payload may unnecessarily reflect user input (email/org_id) back to clients and/or logs.

Possible adjustment (keep only schema issues / minimal context)
 if (!parsedBodyResult.success) {
-  throw simpleError('invalid_json_body', 'Invalid json body', { body, parsedBodyResult })
+  throw simpleError('invalid_json_body', 'Invalid json body', { issues: parsedBodyResult.error?.issues })
 }

Also applies to: 37-43, 53-55, 68-72

supabase/functions/_backend/private/stripe_portal.ts (1)

21-22: Consider: Multiple failure modes share the same error message.

Lines 22, 30, 39, and 44 all return 'not_authorize' with message 'Not authorize'. This is a pre-existing pattern, but distinguishing these cases (e.g., 'missing_authorization', 'invalid_user', 'org_not_found', 'insufficient_rights') would aid debugging.

Also applies to: 29-30, 38-39, 43-44

supabase/functions/_backend/private/create_device.ts (1)

57-68: Consider applying the same pattern to quickError calls for consistency.

The quickError function also has a never return type (as simpleError delegates to it), but lines 58 and 67 still use return quickError(...). While outside the scope of this PR, you may want to address these in a follow-up for full consistency.

supabase/functions/_backend/private/upload_link.ts (1)

28-56: Consider applying the same pattern to quickError calls for consistency.

Lines 29, 43, and 55 use return quickError(...), but quickError also has a never return type. For full consistency with the PR's objective, consider changing these to throw quickError(...) in a follow-up.

supabase/functions/_backend/private/delete_failed_version.ts (1)

26-48: Consider updating quickError calls for consistency.

The quickError function also returns never (throws internally), so lines 27, 31, 40, 44, 47 using return quickError(...) have the same semantic issue this PR addresses for simpleError. Consider updating these to throw quickError(...) for consistency.

supabase/functions/_backend/files/preview.ts (1)

321-324: Consider passing the original error as the cause parameter.

The caught error is logged but not passed to simpleError(). This may lose useful debugging context for upstream error handlers or monitoring.

Proposed fix
   catch (error) {
     cloudlog({ requestId: c.get('requestId'), message: 'failed to serve preview file', error, s3_path: manifestEntry.s3_path })
-    throw simpleError('preview_failed', 'Failed to serve preview file')
+    throw simpleError('preview_failed', 'Failed to serve preview file', {}, error)
   }
supabase/functions/_backend/private/invite_new_user_to_org.ts (2)

36-96: Inconsistent error handling in validateInvite.

This function has a mixed pattern: line 40 now throws on validation failure, but lines 47-48, 64-66, 75-77, 81-83, and 92-94 still return error objects. This inconsistency makes the function harder to reason about—callers must handle both thrown exceptions and returned error objects.

Consider converting all error paths to throw for consistency with the PR's objective.


102-108: Fragile error detection relies on missing inviteCreatorUser.

The check !res.inviteCreatorUser conflates multiple failure modes (user exists, org not found, auth failure, etc.) into a single condition. Combined with the mixed throw/return pattern in validateInvite, this makes error handling unclear.

If validateInvite threw on all errors (as suggested above), this block could be simplified to only handle the success path.

📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f079353 and fcb84fd.

📒 Files selected for processing (39)
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/private/events.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/utils/supabase.ts
🧰 Additional context used
📓 Path-based instructions (7)
supabase/functions/_backend/**/*.{ts,js}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

supabase/functions/_backend/**/*.{ts,js}: Backend code must be placed in supabase/functions/_backend/ as shared code deployed to Cloudflare Workers (API/Plugin/Files workers), Supabase Edge Functions, and other platforms
Use createHono from utils/hono.ts for all Hono framework application initialization and routing
All database operations must use getPgClient() or getDrizzleClient() from utils/pg.ts for PostgreSQL access during active migration to Cloudflare D1
All Hono endpoint handlers must accept Context<MiddlewareKeyVariables> and use c.get('requestId'), c.get('apikey'), and c.get('auth') for request context
Use structured logging with cloudlog({ requestId: c.get('requestId'), message: '...' }) for all backend logging
Use middlewareAPISecret for internal API endpoints and middlewareKey for external API keys; validate against owner_org in the apikeys table
Check c.get('auth')?.authType to determine authentication type ('apikey' vs 'jwt') in backend endpoints
Use Drizzle ORM query patterns with schema from postgress_schema.ts for all database operations; use aliasV2() for self-joins or multiple table references

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
supabase/functions/**/*.{ts,js}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Backend ESLint must pass before commit; run bun lint:backend for backend files

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
**/*.{vue,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Run bun lint to lint Vue, TypeScript, and JavaScript files; use bun lint:fix to auto-fix issues

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

Use single quotes and no semicolons per @antfu/eslint-config rules

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
supabase/functions/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

supabase/functions/**/*.ts: Never use the Supabase admin SDK with service key for user-facing APIs; always use client SDK with user authentication to enforce RLS policies. Admin SDK should only be used for internal operations (triggers, CRON jobs, etc.)
When admin access is unavoidable for a user-facing endpoint, sanitize all user inputs carefully to prevent PostgREST query injection

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
**/*.{ts,tsx,js,jsx,vue}

📄 CodeRabbit inference engine (AGENTS.md)

Run bun lint or lint/format command before validating any backend or frontend task to ensure consistent formatting

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
supabase/functions/_backend/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

Place core backend logic in supabase/functions/_backend/ with plugins, private, public, triggers, and utils subdirectories

Files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/files/files.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/triggers/on_manifest_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/triggers/on_channel_update.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/triggers/cron_stat_org.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/files/preview.ts
  • supabase/functions/_backend/private/latency.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/private/delete_failed_version.ts
  • supabase/functions/_backend/triggers/on_version_create.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
🧠 Learnings (16)
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : Check `c.get('auth')?.authType` to determine authentication type ('apikey' vs 'jwt') in backend endpoints

Applied to files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/private/validate_password_compliance.ts
  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/on_user_update.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/accept_invitation.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : All database operations must use `getPgClient()` or `getDrizzleClient()` from `utils/pg.ts` for PostgreSQL access during active migration to Cloudflare D1

Applied to files:

  • supabase/functions/_backend/private/credits.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : All Hono endpoint handlers must accept `Context<MiddlewareKeyVariables>` and use `c.get('requestId')`, `c.get('apikey')`, and `c.get('auth')` for request context

Applied to files:

  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/utils/hono.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : Use `createHono` from `utils/hono.ts` for all Hono framework application initialization and routing

Applied to files:

  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : Use `middlewareAPISecret` for internal API endpoints and `middlewareKey` for external API keys; validate against `owner_org` in the `apikeys` table

Applied to files:

  • supabase/functions/_backend/utils/hono_middleware_stripe.ts
  • supabase/functions/_backend/private/set_org_email.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/private/invite_new_user_to_org.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : Use structured logging with `cloudlog({ requestId: c.get('requestId'), message: '...' })` for all backend logging

Applied to files:

  • supabase/functions/_backend/triggers/cron_clear_versions.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/cron_sync_sub.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/private/download_link.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/private/stripe_portal.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/private/stripe_checkout.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2026-01-10T04:55:25.264Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:55:25.264Z
Learning: Applies to supabase/functions/_backend/**/*.ts : Place core backend logic in supabase/functions/_backend/ with plugins, private, public, triggers, and utils subdirectories

Applied to files:

  • supabase/functions/_backend/private/create_device.ts
  • supabase/functions/_backend/triggers/on_app_create.ts
  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/triggers/stripe_event.ts
  • supabase/functions/_backend/triggers/credit_usage_alerts.ts
  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/plugin_parser.ts
  • supabase/functions/_backend/triggers/cron_email.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/triggers/cron_stat_app.ts
  • supabase/functions/_backend/triggers/queue_consumer.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2025-12-24T14:11:10.256Z
Learnt from: WcaleNieWolny
Repo: Cap-go/capgo PR: 1300
File: supabase/migrations/20251224103713_2fa_enforcement.sql:409-539
Timestamp: 2025-12-24T14:11:10.256Z
Learning: In supabase/migrations for get_orgs_v6 and get_orgs_v7: The inner functions with user_id parameter (get_orgs_v6(uuid) and get_orgs_v7(uuid)) should NOT be granted to anon/authenticated roles as this allows any user to query other users' organizations; only the no-argument wrapper functions should be public as they perform authentication checks.

Applied to files:

  • supabase/functions/_backend/triggers/on_organization_create.ts
  • supabase/functions/_backend/private/set_org_email.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to cloudflare_workers/files/index.ts : Files Worker (port 8789) handles file upload/download operations

Applied to files:

  • supabase/functions/_backend/files/files.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Use shared backend code from `supabase/functions/_backend/` across all deployment platforms; never create platform-specific implementations outside this directory

Applied to files:

  • supabase/functions/_backend/triggers/on_deploy_history_create.ts
📚 Learning: 2025-10-14T17:30:06.380Z
Learnt from: WcaleNieWolny
Repo: Cap-go/capgo PR: 1222
File: supabase/migrations/20251014135440_add_cron_sync_sub.sql:78-86
Timestamp: 2025-10-14T17:30:06.380Z
Learning: The cron_sync_sub function will NOT be deployed on Cloudflare, so messages queued for 'cron_sync_sub' should not include function_type: 'cloudflare'.

Applied to files:

  • supabase/functions/_backend/triggers/cron_sync_sub.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : Backend code must be placed in `supabase/functions/_backend/` as shared code deployed to Cloudflare Workers (API/Plugin/Files workers), Supabase Edge Functions, and other platforms

Applied to files:

  • supabase/functions/_backend/private/store_top.ts
  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/**/*.{ts,js} : Backend ESLint must pass before commit; run `bun lint:backend` for backend files

Applied to files:

  • supabase/functions/_backend/utils/hono.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/private/log_as.ts
  • supabase/functions/_backend/private/events.ts
📚 Learning: 2025-12-23T02:53:12.055Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-12-23T02:53:12.055Z
Learning: Applies to supabase/functions/_backend/**/*.{ts,js} : Use Drizzle ORM query patterns with `schema` from `postgress_schema.ts` for all database operations; use `aliasV2()` for self-joins or multiple table references

Applied to files:

  • supabase/functions/_backend/utils/hono.ts
📚 Learning: 2026-01-10T04:55:25.264Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:55:25.264Z
Learning: Applies to supabase/functions/**/*.ts : Never use the Supabase admin SDK with service key for user-facing APIs; always use client SDK with user authentication to enforce RLS policies. Admin SDK should only be used for internal operations (triggers, CRON jobs, etc.)

Applied to files:

  • supabase/functions/_backend/private/devices.ts
  • supabase/functions/_backend/utils/supabase.ts
  • supabase/functions/_backend/private/admin_stats.ts
  • supabase/functions/_backend/private/upload_link.ts
  • supabase/functions/_backend/private/stats.ts
  • supabase/functions/_backend/private/log_as.ts
📚 Learning: 2026-01-10T04:55:25.264Z
Learnt from: CR
Repo: Cap-go/capgo PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-01-10T04:55:25.264Z
Learning: Applies to supabase/functions/**/*.ts : When admin access is unavoidable for a user-facing endpoint, sanitize all user inputs carefully to prevent PostgREST query injection

Applied to files:

  • supabase/functions/_backend/private/log_as.ts
🧬 Code graph analysis (38)
supabase/functions/_backend/private/credits.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/validate_password_compliance.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/cron_clear_versions.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/create_device.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/on_app_create.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/on_organization_create.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/files/files.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/set_org_email.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/on_manifest_create.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/on_deploy_history_create.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/cron_sync_sub.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/store_top.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/on_channel_update.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/hono.ts (1)
supabase/functions/_backend/utils/logging.ts (1)
  • cloudlog (3-15)
supabase/functions/_backend/triggers/stripe_event.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/credit_usage_alerts.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/cron_stat_org.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/invite_new_user_to_org.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/logging.ts (1)
  • cloudlog (3-15)
supabase/functions/_backend/files/preview.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/logging.ts (1)
  • cloudlog (3-15)
supabase/functions/_backend/private/latency.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/devices.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/plugin_parser.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/utils.ts (1)
  • fixSemver (55-66)
supabase/functions/_backend/private/download_link.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/downloadUrl.ts (1)
  • getBundleUrl (16-48)
supabase/functions/_backend/triggers/cron_email.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/stripe_portal.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/supabase.ts (2)
  • supabaseClient (38-48)
  • hasOrgRight (287-304)
supabase/functions/_backend/utils/supabase.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/admin_stats.ts (3)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/supabase.ts (1)
  • isAdmin (563-571)
supabase/functions/_backend/utils/logging.ts (1)
  • cloudlog (3-15)
supabase/functions/_backend/triggers/on_user_update.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/stripe_checkout.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/supabase.ts (1)
  • supabaseClient (38-48)
supabase/functions/_backend/private/delete_failed_version.ts (3)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/version.ts (1)
  • version (1-1)
supabase/functions/_backend/utils/s3.ts (1)
  • s3 (146-153)
supabase/functions/_backend/triggers/on_version_create.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/cron_stat_app.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/triggers/queue_consumer.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/upload_link.ts (2)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/utils/s3.ts (1)
  • s3 (146-153)
supabase/functions/_backend/private/stats.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/log_as.ts (2)
supabase/functions/_backend/utils/hono.ts (2)
  • simpleError (247-249)
  • parseBody (251-262)
supabase/functions/_backend/utils/supabase.ts (2)
  • supabaseAdmin (75-84)
  • isAdmin (563-571)
supabase/functions/_backend/private/accept_invitation.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)
supabase/functions/_backend/private/events.ts (1)
supabase/functions/_backend/utils/hono.ts (1)
  • simpleError (247-249)

Comment thread supabase/functions/_backend/private/download_link.ts Outdated
Fixed grammatical error in error codes across 5 files in private/.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
6.7% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@riderx riderx merged commit 8955b7f into main Jan 12, 2026
9 of 11 checks passed
@riderx riderx deleted the riderx/fix-simpleError-throw branch January 12, 2026 13:18
@coderabbitai coderabbitai Bot mentioned this pull request Jan 15, 2026
11 tasks
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