mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Fixed duplicate /assets
in Sentry stacktrace filenames (#18777)
no issue
- For whatever reason, our Sentry stack traces are adding an extra
`/assets` to the filenames in stacktraces from admin
- Attempted to fix this
[here](3e9ee16ffb
)
but it didn't work because at this point the duplication hasn't occurred
yet
- This change strips the `/assets` segment from the filenames, so when
Sentry adds it back in, it doesn't duplicate anything. Would be good to
get to the bottom of why this is happening, but this should hopefully
improve our stacktraces in Sentry in the meantime.
This commit is contained in:
parent
f82a3e0245
commit
42ac31a270
@ -184,11 +184,11 @@ export default Route.extend(ShortcutsRoute, {
|
||||
integrations: [
|
||||
new RewriteFrames({
|
||||
iteratee: (frame) => {
|
||||
console.log('frame: ', frame); // eslint-disable-line no-console
|
||||
console.log('cdnUrl: ', appConfig.cdnUrl); // eslint-disable-line no-console
|
||||
// Remove duplicate `assets/` from CDN file paths (unsure why this occurs though)
|
||||
if (frame.filename?.startsWith(appConfig.cdnUrl) && frame.filename?.includes('assets/assets/')) {
|
||||
frame.filename = frame.filename.replace('assets/assets/', 'assets/');
|
||||
if (this.config.sentry_env === 'production') {
|
||||
// Remove duplicate `assets/` from CDN file paths (unsure why this occurs though)
|
||||
if (frame.filename?.startsWith(appConfig.cdnUrl) && frame.filename?.includes('assets/')) {
|
||||
frame.filename = frame.filename.replace('assets/', '');
|
||||
}
|
||||
}
|
||||
|
||||
return frame;
|
||||
|
Loading…
Reference in New Issue
Block a user