-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Loading status checks…
fix: Fix encoding-related issues with non-utf8 chars (#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.
- @spotlightjs/spotlight@2.11.0
- @spotlightjs/spotlight@2.10.3
- @spotlightjs/spotlight@2.10.2
- @spotlightjs/spotlight@2.10.1
- @spotlightjs/spotlight@2.10.0
- @spotlightjs/sidecar@1.11.2
- @spotlightjs/sidecar@1.11.1
- @spotlightjs/sidecar@1.11.0
- @spotlightjs/overlay@2.12.0
- @spotlightjs/overlay@2.11.1
- @spotlightjs/overlay@2.11.0
- @spotlightjs/overlay@2.10.1
- @spotlightjs/overlay@2.10.0
- @spotlightjs/electron@1.5.0
- @spotlightjs/electron@1.4.3
- @spotlightjs/electron@1.4.2
- @spotlightjs/electron@1.4.1
- @spotlightjs/electron@1.4.0
- @spotlightjs/astro@3.0.0
- @spotlightjs/astro@2.4.3
- @spotlightjs/astro@2.4.2
- @spotlightjs/astro@2.4.1
- @spotlightjs/astro@2.4.0
Showing
18 changed files
with
107 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
'@spotlightjs/overlay': minor | ||
'@spotlightjs/sidecar': minor | ||
--- | ||
|
||
Add base64 encoding for envelope passing | ||
|
||
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. |
3 changes: 3 additions & 0 deletions
3
packages/overlay/_fixtures/envelope_with_nextjs_ansi_escapes.txt
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export function base64Decode(data: string): Uint8Array { | ||
// TODO: Use Uint8Array.fromBase64 when it becomes available | ||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64 | ||
return Uint8Array.from(atob(data), c => c.charCodeAt(0)); | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters