-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(cloudflare): Ensure errors get captured from durable objects #16838
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
e8028fb
to
bf3b996
Compare
This commit introduces Durable Object support in the Cloudflare Workers example to enhance functionality and error tracking via Sentry. It removes outdated tests, updates dependencies, configures Playwright for e2e testing, and refines build/test scripts for CI/CD use cases.
Refactor test structure for clarity and maintainability, including renaming test descriptions and adding `afterEach` for cleaning up mocks. Improve instrumentation validation by checking proper handling of prototype methods and method-specific behaviors. Ensure consistent and detailed coverage of Durable Object functionality.
Introduce `instrumentPrototype` to enhance Sentry instrumentation by proxying prototypes and managing method wrapping at a granular level. Improves maintainability and modularity of the code for durable objects.
bf3b996
to
48f4762
Compare
Replaced hardcoded port value with a dynamic variable for better maintainability and consistency. This change ensures the port is defined in a single location, reducing the risk of errors during updates.
nice! @timfish could you help test this change? |
Simplified the prototype instrumentation logic by replacing the manual mapping of methods with proxies. Added tests to ensure prototype methods are properly instrumented and maintain consistency.
Nice, I'll take a look! I'm in the process of trying to add more integration tests! |
@0xbad0c0d3 as an aside, please email me at my github username -> |
Previously, properties added to the Durable Object receiver were not enumerable, writable, or configurable by default. This change ensures these properties have full flexibility, improving compatibility and developer experience.
Looks like the cloudflare e2e tests skipped. @AbhiPrasad do you know why it skipped those? In this PR the e2e tests have been changed to use Playwright whereas it should be possible to use cloudflare's test architecture. I am currently struggling to get this working myself so if we get the e2e tests passing with this PR we should still probably merge it anyway and get a fix out. Ideally I'd like to get to a point where we have a whole suite of cloudflare tests, maybe under |
It was skipped due to the package.json sentryTest.optional |
Tomorrow I will also push ws e2e tests. |
yeah we should most definitely do this, and just run it separately |
Implemented WebSocket handling with message reception and connection closure logic, including error recording in Sentry. Updated tests to verify WebSocket behaviors and added the "ws" package for WebSocket functionality.
8f57ccf
to
b56cd35
Compare
Fix #16786
yarn lint
) & (yarn test
).