Skip to content

Commit

Permalink
Add warning message when crash reports are skipped during upload
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjduffy committed Nov 8, 2023
1 parent 7f6306b commit 780b4b6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/replay/src/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe("filterRecordings", () => {
},
];

const filtered = filterRecordings(recordings, r => r.id === "3");
const filtered = filterRecordings(recordings, r => r.id === "3", false);
expect(filtered).toHaveLength(1);
});
it("inclues crash reports when includeCrashes is set", () => {
Expand Down
12 changes: 12 additions & 0 deletions packages/replay/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,18 @@ async function uploadAllRecordings(opts: Options & UploadAllOptions = {}) {
const allRecordings = readRecordings(dir).filter(r => !uploadSkipReason(r));
const recordings = filterRecordings(allRecordings, opts.filter, opts.includeCrashes);

if (
allRecordings.some(r => r.status === "crashed") &&
!recordings.some(r => r.status === "crashed") &&
opts.filter &&
!opts.includeCrashes
) {
maybeLog(
opts.verbose,
`\n⚠️ Warning: Some crash reports were created but will not be uploaded because of the provided filter. Add --include-crashes to upload crash reports.\n`
);
}

if (recordings.length === 0) {
if (opts.filter && allRecordings.length > 0) {
maybeLog(opts.verbose, `No replays matched the provided filter`);
Expand Down

0 comments on commit 780b4b6

Please sign in to comment.