-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use SyncPromise internally & Remove deprecated API & Trim Public API #1858
Conversation
Generated by 🚫 dangerJS |
event = await this.eventFromMessage(ex, undefined, hint); | ||
addExceptionTypeValue(event, `${ex}`); | ||
} | ||
public eventFromException(exception: any, hint?: SentryEventHint): SyncPromise<SentryEvent> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully convinced about this SyncPromise
stuff tbh. It adds a level of indirection when in reality we could just use the fully procedural code here as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is correct, problem is that in node this needs to be "async" meaning that we can do file io in node. The function is defined in the interface of Backend, so even though this fully sync in browser, it isn't in node.
|
||
/** JSDoc */ | ||
private readonly attachHandler = (handler: Handler<T, any>) => { | ||
this.handlers = this.handlers.concat(handler); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is odd, as attaching handler always executes it anyway. What's the point of keeping track of them then?
packages/utils/test/is.test.ts
Outdated
describe('isThenable()', () => { | ||
test('should work as advertised', () => { | ||
expect(isThenable(Promise.resolve(true))).toEqual(true); | ||
// expect(isThenable(async () => false)).toEqual(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to add SyncPromise
here as well.
Co-Authored-By: HazAT <[email protected]>
Please do not delete the branch yet, we delete it when we merge do not delete the branch yet |
…1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871
…1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871
…1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871
* fix: Events created from exception shouldnt have top-level message attribute (#1831) * Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871 * ref: Move public interfaces to types package Move addBreadcrumb from the client to the hub * fix: Tests * fix: Small type issues * ref: Remove scope listeners * fix: Add flush to interface * ref: Remove interfaces from core
…1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871
* fix: Events created from exception shouldnt have top-level message attribute (#1831) * Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871 * ref: Move public interfaces to types package Move addBreadcrumb from the client to the hub * fix: Tests * fix: Small type issues * ref: Remove scope listeners * fix: Add flush to interface * ref: Remove interfaces from core
…1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871
* fix: Events created from exception shouldnt have top-level message attribute (#1831) * Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review Co-Authored-By: HazAT <[email protected]> * fix: CodeReview * feat: #1871 * ref: Move public interfaces to types package Move addBreadcrumb from the client to the hub * fix: Tests * fix: Small type issues * ref: Remove scope listeners * fix: Add flush to interface * ref: Remove interfaces from core
…PIs (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review
* fix: Events created from exception shouldnt have top-level message attribute (#1831) * Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review * ref: Move public interfaces to types package * fix: Tests * fix: Small type issues * ref: Remove scope listeners * fix: Add flush to interface * ref: Remove interfaces from core
…PIs (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review
* fix: Events created from exception shouldnt have top-level message attribute (#1831) * Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review * ref: Move public interfaces to types package * fix: Tests * fix: Small type issues * ref: Remove scope listeners * fix: Add flush to interface * ref: Remove interfaces from core
…PIs (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review
* fix: Events created from exception shouldnt have top-level message attribute (#1831) * Use SyncPromise internally & Remove deprecated API & Trim Public API (#1858) * ref: Move PromiseBuffer and Error to utils package * ref: Remove all async api * ref: Remove invokeClientAsync function * feat: Finish Node SDK * feat: SyncPromise implementation * fix: Browser SDK * fix: beforeSend callback * fix: Core tests * fix: linting and tests * fix: browser npm package + add error for manual tests * meta: Remove deprecations * fix: Typedocs and public exposed functions * meta: Changelog * Apply suggestions from code review * ref: Move public interfaces to types package * fix: Tests * fix: Small type issues * ref: Remove scope listeners * fix: Add flush to interface * ref: Remove interfaces from core
This PR changes the internals of all the SDKs to be less
async
.This means that instead of internally using
async/await
/Promise
mostly everywhere, we now use our own implementationSyncPromise
.SyncPromise
is as the name says sync if everything is called directly.This has a lot of advantages when it comes to very high volume calls to our SDKs.
Right now this is marked as a
major
bump because of the huge internal changes.The public facing API shouldn't change, only the API for
Client
changes.Also, we are hiding the
Backend
from the package, to not exposeSyncPromise
.If you were using the
minimal
package or the SDK as we advertised it in the official docs, you shouldn't notice anything.