-
-
Notifications
You must be signed in to change notification settings - Fork 32
Fix(sidecar): Unknown type event error #1111
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
BYK
left a comment
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.
Amazing patch, thank you so much!
| if (Number.isNaN(date.getTime())) { | ||
| // placeholder with same width as valid timestamp for alignment in the logs | ||
| return "??:??:??"; | ||
| } |
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.
<3
| const entry = registry[eventType]; | ||
| const event = payload as SentryEvent; | ||
| if (!entry.typeGuard(event)) { | ||
| logger.warn(`Skipping event: type guard failed for ${eventType} (event.type=${(event as any).type})`); |
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'd be good to dump the event using logger.debug(utils.inspect(event)) and/or sending this to Sentry for inspection
| const hasValidType = !event.type || ERROR_EVENT_TYPES.has(event.type); | ||
| const hasException = Boolean((event as SentryErrorEvent).exception); | ||
| const hasMessage = Boolean((event as SentryErrorEvent).message); | ||
| return hasValidType && (hasException || hasMessage); |
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.
Keep in mind that this version is less performant than the one you replaced as it doesn't "short circut". Might become an issue under heavy load, otherwise impact should be insignificant.
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @spotlightjs/[email protected] ### Minor Changes - Docker compose support for Spotlight run command ([#1108](#1108)) - Added support for Last-Event-Id in SSE stream ([#1104](#1104)) - Change tool names: change `.` for `_` and remove `spotlight` preffix ([#1114](#1114)) - Improved human formatter readability ([#1112](#1112)) ### Patch Changes - Fix breaking error when event type is not supported ([#1111](#1111)) - Fix SDK categorization for Next.js by using User-Agent headers to distinguish browser from server events ([#1110](#1110)) ## @spotlightjs/[email protected] ### Patch Changes - Updated dependencies \[[`0942c8a`](0942c8a), [`bce012e`](bce012e), [`7624030`](7624030), [`15a7f41`](15a7f41), [`13da542`](13da542), [`b3a654a`](b3a654a)]: - @spotlightjs/[email protected] - @spotlightjs/[email protected] ## @spotlightjs/[email protected] ### Patch Changes - Fix SDK categorization for Next.js by using User-Agent headers to distinguish browser from server events ([#1110](#1110)) - Updated dependencies \[[`0942c8a`](0942c8a), [`bce012e`](bce012e), [`7624030`](7624030), [`15a7f41`](15a7f41), [`13da542`](13da542), [`b3a654a`](b3a654a)]: - @spotlightjs/[email protected] - @spotlightjs/[email protected] Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This error what was exiting the program;

This fixes it and also shows a better human output for ISO and UNIX timestamps
Before:

Now:
