@sentry/cloudflare: Durable Object methods called from the constructor's blockConcurrencyWhile callback are captured as untraced RPC entries
Mantenedores costumam responder em até 1 dia
@JPeer264 já está trabalhando nisso.
Desde 28/9/2026.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 58/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- TypeScript
- Estrelas
- 8.7k
- Forks
- 1.9k
- Merge médio
- 1d 17h
- PRs com merge (30d)
- 523
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de getsentry/sentry-javascript
-
javascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
getsentry/sentry-javascript#24200 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
javascript Task
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
getsentry/sentry-javascript#24134 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Cloudflare Workers javascript Tests
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
getsentry/sentry-javascript#24051 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Bug Bun javascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 92/100
getsentry/sentry-javascript#24045 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
vercel-edge: Missing exportsAbertajavascript
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
getsentry/sentry-javascript#24043 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
Todas as issues de getsentry/sentry-javascript
Issues semelhantes
-
needs:triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Mantenedores costumam responder em até 1 dia
-
ai-discovered
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 83/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
jessepollak/home#1627 ·
Mantenedores costumam responder em até 1 dia
-
agent-canvas bug llm priority:low ready-for-dev
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
OpenHands/OpenHands#17806 · 3 comentários ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
radius-project/ai-extensions#923 ·
Mantenedores costumam responder em até 1 dia