-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add upload.maximumLimit
#626
base: main
Are you sure you want to change the base?
Add upload.maximumLimit
#626
Conversation
🦋 Changeset detectedLatest commit: 8f402c3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
@@ -364,6 +365,12 @@ export default class ReplayReporter< | |||
if (typeof config.upload === "object") { | |||
this._minimizeUploads = !!config.upload.minimizeUploads; | |||
this._uploadStatusThreshold = config.upload.statusThreshold ?? "all"; | |||
if (typeof config.upload.maximumLimit === "number") { | |||
if (!Number.isFinite(config.upload.maximumLimit) || config.upload.maximumLimit <= 0) { | |||
throw new Error("`upload.maximumLimit` must be a finite number higher than 0"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "a finite number higher than 0" is technically correct but kind of stuffy. Maybe something more like?
throw new Error("`upload.maximumLimit` must be a finite number higher than 0"); | |
throw new Error("`upload.maximumLimit` must be greater than 0; to disable uploads entirely, set `upload` to false"); |
@@ -763,6 +770,9 @@ export default class ReplayReporter< | |||
}); | |||
return; | |||
} | |||
if (this._uploadedRecordings.size >= this._uploadMaxLimit) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see us accounting for the number of shards here. That seems important?
No description provided.