fix(cloud): forward /api/sentry-tunnel to Sentry ingest#273
Closed
RhysSullivan wants to merge 3 commits intors/secrets-parallel-fanoutfrom
Closed
fix(cloud): forward /api/sentry-tunnel to Sentry ingest#273RhysSullivan wants to merge 3 commits intors/secrets-parallel-fanoutfrom
RhysSullivan wants to merge 3 commits intors/secrets-parallel-fanoutfrom
Conversation
…nked bulk INSERT Drizzle adapter had no native createMany — the factory's fallback looped through per-row inserts. For a Cloudflare-scale OpenAPI spec (~2700 ops) addSpec devolved to ~10 000 sequential INSERTs through Hyperdrive inside a single transaction, blowing both the Worker CPU / memory budget and any reasonable wall-clock. Changes: - storage-core/adapter.ts: CustomAdapter.createMany is now required (no ?). Backends must implement a real bulk insert; there is no silent per-row fallback to mask prod regressions. - storage-core/factory.ts: drop the loop fallback entirely. createMany delegates to inner.createMany, applying per-row input/output transforms so JSON / dates / booleans serialize the same as single create(). - storage-core/testing/memory.ts: native createMany that just pushes rows into the in-memory table. - storage-drizzle/adapter.ts: real db.insert(table).values(rows).returning() in chunks of 500. One statement per chunk (so ~6 round-trips for 2700 ops, not 2700). Chunking also keeps any single statement under ~2MB — a single giant INSERT would choke Hyperdrive ingress and the WASM PGlite used in tests. Fails loudly on mysql (no RETURNING).
Several per-request hot paths iterated secret providers with sequential
yield*, turning a fan-out into N round-trips. Fix by switching to
Effect.all(..., { concurrency: 'unbounded' }).
- executor.ts secretsGet fallback: when the core routing-table misses,
ask every enumerating provider in parallel; first non-null in
registration order wins. Providers that throw are still treated as
'don't have it'.
- executor.ts secretsRemove: delete across every writable provider in
parallel. Providers don't coordinate on ownership — each gets asked,
and most calls are no-ops.
- executor.ts secretsList: provider.list() runs in parallel, then the
results are merged in registration order so 'first provider wins'
precedence remains deterministic.
- openapi/invoke.ts + graphql/invoke.ts resolveHeaders: resolve
secret-backed headers in parallel. OpenAPI fails the invocation on
any missing secret (unchanged semantics); GraphQL drops the header
silently on failure (unchanged semantics).
N is small (3-5 providers, 1-5 headers) so parallelism is unbounded;
no Effect.all concurrency cap needed.
routes/__root.tsx configures the browser Sentry SDK with tunnel: '/api/sentry-tunnel' but nothing served that path — every error report came back RouteNotFound. Add a request middleware (before the /api/* router) that intercepts POST /api/sentry-tunnel, parses the envelope's first-line header to recover the DSN, and forwards the raw body to https://<dsn host>/api/<project>/envelope/. The envelope's DSN is validated against env.SENTRY_DSN (host + pathname) to keep this from being an open relay for the Sentry ingest. Missing DSN → 204; bad envelope → 400.
Owner
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Apr 17, 2026
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 94ce0db | Apr 17 2026, 07:00 PM |
@executor/sdk
@executor/plugin-file-secrets
@executor/plugin-google-discovery
@executor/plugin-graphql
@executor/plugin-keychain
@executor/plugin-mcp
@executor/plugin-oauth2
@executor/plugin-onepassword
@executor/plugin-openapi
@executor/plugin-workos-vault
executor
commit: |
d556b11 to
165e770
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

routes/__root.tsx configures the browser Sentry SDK with
tunnel: '/api/sentry-tunnel' but nothing served that path — every
error report came back RouteNotFound.
Add a request middleware (before the /api/* router) that intercepts
POST /api/sentry-tunnel, parses the envelope's first-line header to
recover the DSN, and forwards the raw body to
https:///api//envelope/. The envelope's DSN is
validated against env.SENTRY_DSN (host + pathname) to keep this from
being an open relay for the Sentry ingest. Missing DSN → 204; bad
envelope → 400.