Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@dinmukhamedm
Copy link
Member

@dinmukhamedm dinmukhamedm commented Jun 25, 2025

Important

Fixes usage reset logic in manageWorkspaceSubscriptionEvent to correctly handle upgrades from the free tier by resetting multiple usage metrics.

  • Behavior:
    • Fixes usage reset logic in manageWorkspaceSubscriptionEvent in utils.ts when upgrading from free tier.
    • Resets spansBytesIngestedSinceReset, browserSessionEventsBytesIngestedSinceReset, and stepCountSinceReset to 0.
  • Database Queries:
    • Adds query to fetch tierId before updating workspace subscription.
    • Removes redundant currentTier query in manageWorkspaceSubscriptionEvent.

This description was created by Ellipsis for 960614c. You can customize this summary. It will automatically update as commits are pushed.

Copy link
Contributor

@greptile-apps greptile-apps bot left a 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.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a 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 38 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 4 draft 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% <= threshold 50% 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% <= threshold 50% 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% <= threshold 50% 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 Ellipsis by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.

olzhik11

This comment was marked as spam.

@dinmukhamedm dinmukhamedm merged commit d3c9434 into dev Jun 25, 2025
3 checks passed
@dinmukhamedm dinmukhamedm deleted the fix/reset-usage-on-upgrade branch June 25, 2025 13:35
olzhik11 added a commit that referenced this pull request Jun 26, 2025
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants