@sentry/cloudflare: Durable Object methods called from the constructor's blockConcurrencyWhile callback are captured as untraced RPC entries
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 58/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
Rechercherichtung
Start in durableobject.ts at the RPC prototype wrapper and its startNewTrace branch, then run the provided Store reproduction with @cloudflare/vitest-pool-workers. Trace the constructor's blockConcurrencyWhile callback and verify that a caught init error no longer produces an error event or an untraced RPC entry.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Version
@sentry/cloudflare 10.75.1, with enableRpcTracePropagation: true
Summary
Since #24512, the RPC prototype wrapper instruments any prototype method called while the isolation scope is the default one, in a new trace. The wrapper is installed after construction, but a blockConcurrencyWhile callback started in the constructor runs after that, with no isolation scope. So a method the object calls on itself during initialisation is treated as an untraced RPC entry. If it throws, the error is captured as handled: false with mechanism auto.faas.cloudflare.durable_object, even when the object catches it.
Repro
class Store extends DurableObject {
failure?: Error;
constructor(ctx: DurableObjectState, env: Env) {
super(ctx, env);
void ctx.blockConcurrencyWhile(async () => {
try { this.init(); } catch (e) { this.failure = e as Error; }
});
}
init(): void { throw new Error('init failed'); }
ping(): string { return this.failure ? 'degraded' : 'ok'; }
}
export const Instrumented = Sentry.instrumentDurableObjectWithSentry(
(env) => ({ dsn: env.SENTRY_DSN, enableRpcTracePropagation: true }),
Store,
);
Call ping() on a stub.
Expected: no error event. The error is caught inside the object.
Actual: one error event for init failed, handled: false, in its own trace.
Observed in real workerd (@cloudflare/vitest-pool-workers). With a raised Error.stackTraceLimit, the capturing frame is the untraced startNewTrace branch in durableobject.ts, wrapping the method called from the constructor's blockConcurrencyWhile callback.
Notes
Declaring internal methods as #private avoids it, because they are no longer on the prototype, and that matches Cloudflare's RPC visibility guidance (https://developers.cloudflare.com/workers/runtime-apis/rpc/visibility/). It may be worth either documenting that, or running constructor-time blockConcurrencyWhile callbacks inside an isolation scope so they are not mistaken for RPC entries.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 8.7k
- Forks
- 1.9k
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 523
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus getsentry/sentry-javascript
-
Next.js: basePath is concatenated onto absolute router.push hrefs, corrupting navigation transaction namesEvtl. vergeben @Lms24 hat das vor 3 Tagen übernommen. OffenBrowser Bug Next.js Traces
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
getsentry/sentry-javascript#24672 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
javascript
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
getsentry/sentry-javascript#24200 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
javascript Task
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
getsentry/sentry-javascript#24134 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Cloudflare Workers javascript Tests
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
getsentry/sentry-javascript#24051 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Bug Bun javascript
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 92/100
getsentry/sentry-javascript#24045 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in getsentry/sentry-javascript
Ähnliche Issues
-
check:passed streams:add
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Fission-AI/OpenSpec#1986 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
nestjs/docs.nestjs.com#3554 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
publicodes/publicodes#868 ·
-
namespace operations
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
EclipseFdn/open-vsx.org#13488 ·
Maintainer antworten meist innerhalb von 2 Tagen