-
Notifications
You must be signed in to change notification settings - Fork 0
fix(gst): acquire filed GSTR-1 artifacts from the surfaces the portal offers #353
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
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
1006f56
fix(gst): acquire filed GSTR-1 artifacts from the surfaces the portal…
lamemustafa 83dd53f
fix(background): name the failing symbol when a background handler th…
lamemustafa efc5ba9
test(gst): pin the filed GSTR-1 acquisition surfaces and the handler …
lamemustafa babcedc
refactor(gst): let the compiler hold the acquisition-diagnostic lists
lamemustafa 49ec1b4
fix(privacy): stop three sinks repeating what they were handed
lamemustafa 9b12a26
fix(gst): ask the page, not the page's text, on two GSTR-1 decisions
lamemustafa 583654a
fix(gst): keep a failure's reason when the page cannot be asked why
lamemustafa 758b35a
fix(gst): stop decoding a body already known to be too large
lamemustafa 50cf3ca
test(gst): pin the eight readings this change stopped trusting
lamemustafa 9beb1ab
docs(gst): record the second shape of the GSTR-1 detail route
lamemustafa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| // Enough to name a thrown failure, and nothing that could carry portal text. | ||
| // | ||
| // An error's message is not safe to render: it can quote a page, a URL, or a field value. Its | ||
| // class name and the innermost stack symbol can name where a failure happened without repeating | ||
| // anything the portal said -- but only if each is established to be this bundle's, rather than | ||
| // merely made to look harmless. | ||
| // | ||
| // Stripping punctuation was the earlier approach and it was worse than no filter: a frame pointing | ||
| // at a portal URL came back with its slashes deleted, so the value *looked* like a symbol | ||
| // precisely because the characters that would have exposed it were gone. A filter that launders | ||
| // its input is not a guard. | ||
| // | ||
| // This exists because a discarded error cost three separate round trips to locate, each needing a | ||
| // build and a live authenticated run. | ||
|
|
||
| // A frame names a place in this bundle only when the file it points at is this bundle's. The | ||
| // symbol is what is kept; the URL is what proves the symbol is ours, and it is never kept. An | ||
| // anonymous frame has no symbol to take, and a frame from anywhere else does not match at all. | ||
| const BUNDLE_FRAME = /^\s*at\s+(?:async\s+)?([A-Za-z_$][\w$.]{0,59})\s+\(chrome-extension:\/\//u; | ||
|
|
||
| // Every error class in this bundle ends in `Error`, as do the platform's own; `DOMException` is | ||
| // the one exception the platform makes. Letters and that suffix cannot spell a GSTIN, an ARN, or | ||
| // a URL, and a name that fails the shape degrades to `Error` rather than being laundered into one. | ||
| const BUNDLE_ERROR_NAME = /^[A-Za-z]{1,40}Error$/u; | ||
|
|
||
| function safeErrorName(name: string): string { | ||
| if (name === "DOMException") return name; | ||
| return BUNDLE_ERROR_NAME.test(name) ? name : "Error"; | ||
| } | ||
|
|
||
| export function backgroundFailureFingerprint(error: unknown): string { | ||
| if (!(error instanceof Error)) return "NonError"; | ||
| const name = safeErrorName(error.name || "Error"); | ||
| const symbol = | ||
| typeof error.stack === "string" | ||
| ? (error.stack | ||
| .split("\n") | ||
| .slice(1) | ||
| .map((line) => BUNDLE_FRAME.exec(line)?.[1]) | ||
| .find(Boolean) ?? "") | ||
| : ""; | ||
| return symbol ? `${name} at ${symbol}` : name; | ||
| } |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.