-
Notifications
You must be signed in to change notification settings - Fork 80
fix(ses,lockdown): make filenames in stacktraces clickable #2747
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
Merged
Conversation
This file contains hidden or 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
Draft
3 tasks
7465c6a
to
42ac958
Compare
d4c1a93
to
4f519e4
Compare
42ac958
to
e7158a9
Compare
4f519e4
to
f98efc0
Compare
cdc3255
to
4520477
Compare
f98efc0
to
e7f81bd
Compare
4520477
to
399cf46
Compare
e7f81bd
to
fda2e75
Compare
399cf46
to
abdd6fc
Compare
👍 for clickable files |
abdd6fc
to
f388379
Compare
544a597
to
6a34c19
Compare
boneskull
approved these changes
May 16, 2025
6a34c19
to
b130151
Compare
boneskull
pushed a commit
that referenced
this pull request
Jun 4, 2025
Refs: #2359 ## Description Added two new `stackFiltering:` options - `'omit-frames'` -- Only omit likely uninteresting frames. Keep original paths. - `'shorten-paths'` -- Only shorten paths to text likely clickable in an IDE This fills out the matrix of what should have been orthogonal options. The existing `'concise'` setting both omits likely uninteresting frames and shortens their paths. The existing `'verbose'` setting does neither. The path shortening caused by either `'concise'` or `'shorten-paths'` is also enhanced with two new transformations, in order to make these paths easily and usefully clickable in an IDE like vscode. - We would already shorten, for example ``` 'Object.bar (/vat-v1/.../eventual-send/test/deep-send.test.js:13:21)' ``` to ``` 'Object.bar (eventual-send/test/deep-send.test.js:13:21)'. ``` As of this PR, we would also shorten, for example ``` 'Object.bar (.../eventual-send/test/deep-send.test.js:13:21)' ``` to ``` 'Object.bar (eventual-send/test/deep-send.test.js:13:21)'. ``` - As of this PR, we would would shorten, for example ``` 'Object.bar (file://test/deep-send.test.js:13:21)' ``` to ``` 'Object.bar (test/deep-send.test.js:13:21)'. ``` because the shorter string is a valid relative path, which is therefore usefully clickable. But we would still not shorten or transform, for example ``` 'file:///Users/markmiller/src/ongithub/endojs/endo/packages/eventual-send/test/deep-send.test.js:13:21' ``` because three slashes are normally followed by an absolute path, which is therefore usefully clickable. - [x] This PR changes commit-debug.js from `'errorTaming: 'unsafe-debug'` to `errorTaming: 'unsafe'` so that exiting programs whose initialization goes through `commit-debug.js` can benefit from `stackFiltering:` at all, as well as these new enhancements. TODO but this PR must also fix, by other means, the typescript line number bug that motivated `'unsafe-debug'` in the first place. See #2359 - Manually verified that the typescript bug that motivated `'unsafe-debug'` is now fixed, and so `'unsafe-debug'` is no longer necessary. Presumably this is because we moved to erasable-typescript which does not change line and column numbers. - [ ] This PR does not change that all this `stackFiltering:` logic is specific to v8. We should move and generalize this code so that it applies to all relevant JS platforms. TODO at least file an issue for that. ### Security Considerations none ### Scaling Considerations none ### Documentation Considerations Wherever we document the `stackFiltering:` rules, we should update those. This PR already updates such documentation within agoric-sdk itself. ### Testing Considerations `stackFiltering:` is hard to automatically test because there is no specified or portable behavior for the platform-provided stacks. Instead, we just have manual inspection tests, where you run it and visually sanity check the output. I have added such checks for the new options setting and manually sanity checked them. ### Compatibility Considerations The only observable change to existing programs is the more aggressive path shortening explained above. I doubt this will cause any compat problems, especially since the platform stack traces are unspecified anyway. ### Upgrade Considerations None. - [x] Update `NEWS.md` for user-facing changes.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refs: #2359
Description
Added two new
stackFiltering:
options'omit-frames'
-- Only omit likely uninteresting frames. Keep original paths.'shorten-paths'
-- Only shorten paths to text likely clickable in an IDEThis fills out the matrix of what should have been orthogonal options.
The existing
'concise'
setting both omits likely uninteresting frames andshortens their paths. The existing
'verbose'
setting does neither.The path shortening caused by either
'concise'
or'shorten-paths'
is also enhanced with two new transformations, in order to make these paths easily and usefully clickable in an IDE like vscode.We would already shorten, for example
to
As of this PR, we would also shorten, for example
to
As of this PR, we would would shorten, for example
to
because the shorter string is a valid relative path, which is therefore usefully clickable.
But we would still not shorten or transform, for example
because three slashes are normally followed by an absolute path, which is therefore usefully clickable.
This PR changes commit-debug.js from
'errorTaming: 'unsafe-debug'
toerrorTaming: 'unsafe'
so that exiting programs whose initialization goes throughcommit-debug.js
can benefit fromstackFiltering:
at all, as well as these new enhancements. TODO but this PR must also fix, by other means, the typescript line number bug that motivated'unsafe-debug'
in the first place. See fix(lockdown): change commit-debug.js to unsafe-debug #2359'unsafe-debug'
is now fixed, and so'unsafe-debug'
is no longer necessary. Presumably this is because we moved to erasable-typescript which does not change line and column numbers.This PR does not change that all this
stackFiltering:
logic is specific to v8. We should move and generalize this code so that it applies to all relevant JS platforms. TODO at least file an issue for that.Security Considerations
none
Scaling Considerations
none
Documentation Considerations
Wherever we document the
stackFiltering:
rules, we should update those. This PR already updates such documentation within agoric-sdk itself.Testing Considerations
stackFiltering:
is hard to automatically test because there is no specified or portable behavior for the platform-provided stacks. Instead, we just have manual inspection tests, where you run it and visually sanity check the output. I have added such checks for the new options setting and manually sanity checked them.Compatibility Considerations
The only observable change to existing programs is the more aggressive path shortening explained above. I doubt this will cause any compat problems, especially since the platform stack traces are unspecified anyway.
Upgrade Considerations
None.
NEWS.md
for user-facing changes.