-
Notifications
You must be signed in to change notification settings - Fork 2
chore(root): clean up unused code change entries #1
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
Merged
Changes from all commits
Commits
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| { | ||
| "mcpServers": { | ||
| "sentry": { | ||
| "type": "http", | ||
| "url": "https://mcp.sentry.dev/mcp" | ||
| } | ||
| } | ||
| } |
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,77 @@ | ||
| /** | ||
| * Sentry configuration | ||
| * Central place to manage which browser errors are worth reporting. | ||
| * | ||
| * The site embeds AdSense and is visited with all kinds of extensions and | ||
| * in-app webviews injected into the page. Those scripts throw constantly and | ||
| * Sentry attributes the failures to us, which buries the errors we can act on. | ||
| */ | ||
|
|
||
| import type { ErrorEvent } from '@sentry/tanstackstart-react'; | ||
|
drav0011 marked this conversation as resolved.
|
||
|
|
||
| /** | ||
| * Error messages that never originate from our own code. | ||
| */ | ||
| export const SENTRY_IGNORE_ERRORS: (string | RegExp)[] = [ | ||
| // Google AdSense internals | ||
| 'Accessing domItems after disposal', | ||
| '__tcfapiCall', | ||
| /googlesyndication\.com/, | ||
| /contentDocument\.body/, | ||
|
|
||
| // Extensions and injected globals | ||
| /\b(LIDNotify|xbrowser|swbrowser)\b is not defined/, | ||
| /window\.ethereum/, | ||
| 'Invalid call to runtime.sendMessage', | ||
| 'WKWebView API client did not respond to this postMessage', | ||
|
|
||
| // Opaque cross-origin failures with no recoverable detail | ||
| 'Non-Error promise rejection captured', | ||
| 'ResizeObserver loop completed with undelivered notifications', | ||
| 'ResizeObserver loop limit exceeded', | ||
| ]; | ||
|
|
||
| /** | ||
| * Script origins we never want to attribute errors to. | ||
| */ | ||
| export const SENTRY_DENY_URLS: RegExp[] = [ | ||
| // Ad and analytics providers | ||
| /googlesyndication\.com/, | ||
| /googletagservices\.com/, | ||
| /googletagmanager\.com/, | ||
| /google-analytics\.com/, | ||
| /doubleclick\.net/, | ||
| /\/pagead\//, | ||
|
|
||
| // Affiliate banner | ||
| /bisecthosting\.com/, | ||
|
|
||
| // Browser extensions | ||
| /^chrome-extension:\/\//, | ||
| /^moz-extension:\/\//, | ||
| /^safari-(web-)?extension:\/\//, | ||
| /^webkit-masked-url:/, | ||
| ]; | ||
|
|
||
| /** | ||
| * Drop events that carry no usable stack frames. | ||
| * | ||
| * These are the cross-origin `Script error.` class: a message, no file, no | ||
| * line we can map back to a release. They are unactionable by definition, and | ||
| * on this site they come from injected third-party scripts. | ||
| * @param event - Event Sentry is about to send | ||
| * @returns The event to send, or null to drop it | ||
| */ | ||
| export function dropUnactionableEvent(event: ErrorEvent): ErrorEvent | null { | ||
| const values = event.exception?.values; | ||
|
|
||
| if (!values?.length) { | ||
| return event; | ||
| } | ||
|
|
||
| const hasUsableFrame = values.some(value => | ||
| value.stacktrace?.frames?.some(frame => Boolean(frame.filename) && frame.filename !== '<anonymous>'), | ||
| ); | ||
|
|
||
| return hasUsableFrame ? event : null; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| import { resolveDownloadFileName } from '@/utils/packs'; | ||
| import { describe, expect, it } from 'vitest'; | ||
|
|
||
| describe('resolveDownloadFileName', () => { | ||
| it('takes the file name from an absolute URL', () => { | ||
| expect(resolveDownloadFileName('https://bedrocktweaks.net/download/abc123/BTRP-042.mcpack', 'fallback')) | ||
| .toBe('BTRP-042.mcpack'); | ||
| }); | ||
|
|
||
| it('resolves a relative URL against the current page', () => { | ||
| expect(resolveDownloadFileName('/download/abc123/BTRP-042.mcpack', 'fallback')) | ||
| .toBe('BTRP-042.mcpack'); | ||
| }); | ||
|
|
||
| it('decodes percent-encoded file names', () => { | ||
| expect(resolveDownloadFileName('https://bedrocktweaks.net/download/abc123/My%20Pack.mcpack', 'fallback')) | ||
| .toBe('My Pack.mcpack'); | ||
| }); | ||
|
|
||
| it('keeps the raw segment when percent-encoding is malformed', () => { | ||
| expect(resolveDownloadFileName('https://bedrocktweaks.net/download/abc123/100%.mcpack', 'fallback')) | ||
| .toBe('100%.mcpack'); | ||
| }); | ||
|
|
||
| it('strips query strings and fragments', () => { | ||
| expect(resolveDownloadFileName('https://bedrocktweaks.net/download/abc123/BTRP-042.mcpack?t=1#top', 'fallback')) | ||
| .toBe('BTRP-042.mcpack'); | ||
| }); | ||
|
|
||
| // The regression behind BT-REACT-3: these used to throw out of the mutation's | ||
| // onSuccess callback, which aborted the click that starts the download. | ||
| it.each([ | ||
| ['an unparseable URL', 'not a url at all'], | ||
| ['a malformed protocol', 'https,http://bedrocktweaks.net/download/abc/x.mcpack'], | ||
| ['an empty string', ''], | ||
| ['undefined', undefined], | ||
| ])('does not throw for %s', (_label, downloadUrl) => { | ||
| expect(() => resolveDownloadFileName(downloadUrl, 'fallback')).not.toThrow(); | ||
| }); | ||
|
|
||
| it('falls back to the pack name when no file name can be recovered', () => { | ||
| expect(resolveDownloadFileName(undefined, 'BTRP-042')).toBe('BTRP-042'); | ||
| expect(resolveDownloadFileName('', 'BTRP-042')).toBe('BTRP-042'); | ||
| expect(resolveDownloadFileName('https://bedrocktweaks.net/download/', 'BTRP-042')).toBe('BTRP-042'); | ||
| }); | ||
| }); |
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.