Skip to content
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

fix: Fix encoding-related issues with non-utf8 chars #659

Merged
merged 1 commit into from
Jan 20, 2025
Merged

Conversation

BYK
Copy link
Member

@BYK BYK commented Jan 17, 2025

This fixes the issue certain characters getting lost or changed during the implicit
and forced UTF-8 encoding, namely certain ANSI-escape characters when we capture
them as breadcrumbs. This was breaking NextJS recently.

The mechanism is opt-in from Sidecar side and the new overlay automatically opts
in to fix the issue. The new overlay is also capable of processing messages w/o
base64 encoding so this change is both backwards and forwards compatible meaning
a new version of overlay can work with an old sidecar and a new version of sidecar
can work with an older overlay. That said to get the fix, both should be on the new
version, opting into base64 encoding.

Copy link

vercel bot commented Jan 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
spotlightjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 20, 2025 11:28pm

Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 75.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 31.29%. Comparing base (356890c) to head (f5f586c).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ay/src/integrations/sentry/data/sentryDataCache.ts 66.66% 1 Missing ⚠️
packages/overlay/src/integrations/sentry/index.ts 66.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #659      +/-   ##
==========================================
- Coverage   31.31%   31.29%   -0.02%     
==========================================
  Files          92       92              
  Lines        5438     5435       -3     
  Branches      100      100              
==========================================
- Hits         1703     1701       -2     
+ Misses       3735     3734       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@BYK BYK marked this pull request as ready for review January 20, 2025 23:46
@BYK BYK merged commit 277bd76 into main Jan 20, 2025
17 checks passed
@BYK BYK deleted the nospzwsryoro branch January 20, 2025 23:47
BYK pushed a commit that referenced this pull request Jan 22, 2025
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/astro@2.4.0

### Minor Changes

-   Render placeholders when missing known attributes in Sentry events
    ([#656](#656))

### Patch Changes

-   Updated dependencies

\[[`5d8c7058300b349cd17d543874cfb810ff7db8d9`](5d8c705),

[`cfa9cc967da8aa862f55c3880aab44f7d5b5eeb4`](cfa9cc9),

[`356890c6faf4ef3d9ebf85615e3f43f34fca0439`](356890c)]:
    -   @spotlightjs/spotlight@2.10.0

## @spotlightjs/electron@1.4.0

### Minor Changes

-   Render placeholders when missing known attributes in Sentry events
    ([#656](#656))

### Patch Changes

-   Add `spotlight@` prefix to Sentry releases to distinguish them
    ([#660](#660))

-   Updated dependencies

\[[`8bed105e28f11c139c00f6b4a63717b1fb99d396`](8bed105),

[`4c1b619079d4a1ca0e280dedef89bb8e1bf3f069`](4c1b619),

[`9606eb25434468bb9377569667f4071a177b85ab`](9606eb2),

[`cfa9cc967da8aa862f55c3880aab44f7d5b5eeb4`](cfa9cc9),

[`277bd766aead9a6eabf043cc2490f59d0e1729b6`](277bd76),

[`356890c6faf4ef3d9ebf85615e3f43f34fca0439`](356890c)]:
    -   @spotlightjs/overlay@2.10.0
    -   @spotlightjs/sidecar@1.11.0

## @spotlightjs/overlay@2.10.0

### Minor Changes

-   Render placeholders when missing known attributes in Sentry events
    ([#656](#656))

- Add base64 encoding for envelope passing
([#659](#659))

This fixes the issue certain characters getting lost or changed during
the implicit and forced UTF-8 encoding, namely
certain ANSI-escape characters when we capture them as breadcrumbs. This
was breaking NextJS recently.

The mechanism is opt-in from Sidecar side and the new overlay
automatically opts in to fix the issue. The new overlay
is also capable of processing messages w/o base64 encoding so this
change is both backwards and forwards compatible
meaning a new version of overlay can work with an old sidecar and a new
version of sidecar can work with an older
overlay. That said to get the fix, both should be on the new version,
opting into base64 encoding.

### Patch Changes

-   Fix direct transport init when sidecar transport is already enabled
    ([#658](#658))

- Add auto-reload dev mode for Overlay
([#657](#657))

-   Add `spotlight@` prefix to Sentry releases to distinguish them
    ([#660](#660))

## @spotlightjs/sidecar@1.11.0

### Minor Changes

- Add base64 encoding for envelope passing
([#659](#659))

This fixes the issue certain characters getting lost or changed during
the implicit and forced UTF-8 encoding, namely
certain ANSI-escape characters when we capture them as breadcrumbs. This
was breaking NextJS recently.

The mechanism is opt-in from Sidecar side and the new overlay
automatically opts in to fix the issue. The new overlay
is also capable of processing messages w/o base64 encoding so this
change is both backwards and forwards compatible
meaning a new version of overlay can work with an old sidecar and a new
version of sidecar can work with an older
overlay. That said to get the fix, both should be on the new version,
opting into base64 encoding.

### Patch Changes

- Upgrades source-map dependency to avoid mappings.wasm error
([#638](#638))

## @spotlightjs/spotlight@2.10.0

### Minor Changes

-   Render placeholders when missing known attributes in Sentry events
    ([#656](#656))

### Patch Changes

- Remove Windows home directories from Sentry reports
([#644](#644))

-   Add `spotlight@` prefix to Sentry releases to distinguish them
    ([#660](#660))

-   Updated dependencies

\[[`8bed105e28f11c139c00f6b4a63717b1fb99d396`](8bed105),

[`4c1b619079d4a1ca0e280dedef89bb8e1bf3f069`](4c1b619),

[`9606eb25434468bb9377569667f4071a177b85ab`](9606eb2),

[`cfa9cc967da8aa862f55c3880aab44f7d5b5eeb4`](cfa9cc9),

[`277bd766aead9a6eabf043cc2490f59d0e1729b6`](277bd76),

[`356890c6faf4ef3d9ebf85615e3f43f34fca0439`](356890c)]:
    -   @spotlightjs/overlay@2.10.0
    -   @spotlightjs/sidecar@1.11.0

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant