-
-
Notifications
You must be signed in to change notification settings - Fork 337
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'antonis/3859-newCaptureFeedbackAPI-Form' into antonis/3…
…959-captureFeedback-attachements
- Loading branch information
Showing
77 changed files
with
285 additions
and
214 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
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
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 |
---|---|---|
|
@@ -6,6 +6,7 @@ export type { | |
Exception, | ||
SendFeedbackParams, | ||
SeverityLevel, | ||
Span, | ||
StackFrame, | ||
Stacktrace, | ||
Thread, | ||
|
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
2 changes: 1 addition & 1 deletion
2
packages/core/src/js/integrations/reactnativeerrorhandlersutils.ts
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 |
---|---|---|
@@ -1,5 +1,72 @@ | ||
import { makeFifoCache } from '@sentry/utils'; | ||
|
||
import type { AndroidCombinedProfileEvent, CombinedProfileEvent } from './types'; | ||
|
||
export const PROFILE_QUEUE = makeFifoCache<string, CombinedProfileEvent | AndroidCombinedProfileEvent>(20); | ||
|
||
/** | ||
* Creates a cache that evicts keys in fifo order | ||
* @param size {Number} | ||
*/ | ||
function makeFifoCache<Key extends string, Value>( | ||
size: number, | ||
): { | ||
get: (key: Key) => Value | undefined; | ||
add: (key: Key, value: Value) => void; | ||
delete: (key: Key) => boolean; | ||
clear: () => void; | ||
size: () => number; | ||
} { | ||
// Maintain a fifo queue of keys, we cannot rely on Object.keys as the browser may not support it. | ||
let evictionOrder: Key[] = []; | ||
let cache: Record<string, Value> = {}; | ||
|
||
return { | ||
add(key: Key, value: Value) { | ||
while (evictionOrder.length >= size) { | ||
// shift is O(n) but this is small size and only happens if we are | ||
// exceeding the cache size so it should be fine. | ||
const evictCandidate = evictionOrder.shift(); | ||
|
||
if (evictCandidate !== undefined) { | ||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete cache[evictCandidate]; | ||
} | ||
} | ||
|
||
// in case we have a collision, delete the old key. | ||
if (cache[key]) { | ||
this.delete(key); | ||
} | ||
|
||
evictionOrder.push(key); | ||
cache[key] = value; | ||
}, | ||
clear() { | ||
cache = {}; | ||
evictionOrder = []; | ||
}, | ||
get(key: Key): Value | undefined { | ||
return cache[key]; | ||
}, | ||
size() { | ||
return evictionOrder.length; | ||
}, | ||
// Delete cache key and return true if it existed, false otherwise. | ||
delete(key: Key): boolean { | ||
if (!cache[key]) { | ||
return false; | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete | ||
delete cache[key]; | ||
|
||
for (let i = 0; i < evictionOrder.length; i++) { | ||
if (evictionOrder[i] === key) { | ||
evictionOrder.splice(i, 1); | ||
break; | ||
} | ||
} | ||
|
||
return true; | ||
}, | ||
}; | ||
} |
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
Oops, something went wrong.