-
Notifications
You must be signed in to change notification settings - Fork 155
fix reset usage when upgrading #657
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
Conversation
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.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
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.
Important
Looks good to me! 👍
Reviewed everything up to 960614c in 1 minute and 1 seconds. Click for details.
- Reviewed
38lines of code in1files - Skipped
0files when reviewing. - Skipped posting
4draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. frontend/lib/checkout/utils.ts:76
- Draft comment:
New query 'tierBeforeUpdate' retrieves the workspace tier before updates. This ensures the usage reset condition is based on the pre-update state. Consider handling the case where no workspace is found (i.e. tierBeforeUpdate is null) if that scenario is possible. - Reason this comment was not posted:
Confidence changes required:33%<= threshold50%None
2. frontend/lib/checkout/utils.ts:93
- Draft comment:
Removed duplicate 'currentTier' query. Using the pre-update tier (tierBeforeUpdate) is a cleaner approach to determine if usage reset is needed. - Reason this comment was not posted:
Comment was not on a location in the diff, so it can't be submitted as a review comment.
3. frontend/lib/checkout/utils.ts:104
- Draft comment:
The usage reset now checks if the previous tier was free (tier id 1) using tierBeforeUpdate. Ensure that the free tier is always represented by id 1 and that this logic covers all intended upgrade scenarios. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the author to ensure that the free tier is always represented by id 1 and that the logic covers all intended upgrade scenarios. This is asking the author to double-check their logic and assumptions, which violates the rules.
4. frontend/lib/checkout/utils.ts:105
- Draft comment:
Usage reset now updates 'spansBytesIngestedSinceReset', 'browserSessionEventsBytesIngestedSinceReset', and 'stepCountSinceReset'. Confirm these column names match the schema and intended usage metrics. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%<= threshold50%The comment is asking the PR author to confirm that the column names match the schema and intended usage metrics. This falls under asking the author to confirm their intention, which is against the rules. Therefore, this comment should be removed.
Workflow ID: wflow_Aaf6B0g8oJraRGvb
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
* estimate span size before any processing (#654) * Feat/lam 682 (#655) * feat: update delete project, fix spans filters * fix: rendering, model fallback * feat: move delete endpoint to next * feat: fix margins * feat: update delete project data in ch, fix comments * fix: command * feat: add debug console * feat: move helper function * allow CTES in SQL editor (#653) * allow CTES in SQL editor * remove debug console.log * fix reset usage when upgrading (#657) * Hotfix/ack browser events (#660) * first ack browser events, then increment usage * don't wait for async insert on browser events * feat: fix decode key by passing in docker file (#661) * feat: fix decode key by passing in docker file * feat: add key to full build --------- Co-authored-by: Dinmukhamed Mailibay <[email protected]>
Important
Fixes usage reset logic in
manageWorkspaceSubscriptionEventto correctly handle upgrades from the free tier by resetting multiple usage metrics.manageWorkspaceSubscriptionEventinutils.tswhen upgrading from free tier.spansBytesIngestedSinceReset,browserSessionEventsBytesIngestedSinceReset, andstepCountSinceResetto 0.tierIdbefore updating workspace subscription.currentTierquery inmanageWorkspaceSubscriptionEvent.This description was created by
for 960614c. You can customize this summary. It will automatically update as commits are pushed.