Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Delete persisted captures from v3 as the format has changed
  • Loading branch information
timfish committed Jun 17, 2022
commit e713af0afbae819cf5c8e653a94c899f93134b90
6 changes: 5 additions & 1 deletion src/main/transports/queue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ const MILLISECONDS_PER_DAY = 86_400_000;
interface PersistedRequest {
bodyPath: string;
date: Date;
// Envelopes were persisted in a different format in v3
// If this property exists, we discard this event
type?: unknown;
}

export interface QueuedTransportRequest extends TransportRequest {
Expand Down Expand Up @@ -59,7 +62,8 @@ export class PersistedRequestQueue {

this._queue.update((queue) => {
while ((found = queue.shift())) {
if (found.date.getTime() < cutOff) {
// We drop events created in v3 of the SDK or before the cut-off
if ('type' in found || found.date.getTime() < cutOff) {
// we're dropping this event so delete the body
void this._removeBody(found.bodyPath);
found = undefined;
Expand Down