Skip to content
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

fix(billing): handle string usage limits TASK-1232 #5227

Merged

Conversation

jamesrkiger
Copy link
Contributor

@jamesrkiger jamesrkiger commented Nov 5, 2024

🗒️ Checklist

  1. run linter locally
  2. update all related docs (API, README, inline, etc.), if any
  3. draft PR with a title <type>(<scope>)<!>: <title> TASK-1234
  4. tag PR: at least frontend or backend unless it's global
  5. fill in the template below and delete template comments
  6. review thyself: read the diff and repro the preview as written
  7. open PR & confirm that CI passes
  8. request reviewers, if needed
  9. delete this section before merging

📣 Summary

Fixes backend code to handle usage limits that come from Stripe metadata as strings representing either numbers or "unlimited" usage.

👀 Preview steps

  1. Create a user and sign them up for a paid subscription
  2. Make a project with an audio question and make a submission with an audio file
  3. Navigate to NLP processing for that answer. Manually write a short transcription.
  4. On billing-addons-backend branch, try running an automatic translation of that transcription. You will get a 500 error from the backend because the string for the usage limit is being compared to an int.
  5. On this branch, you will get a successful transcription.

💭 Notes

I would like to have set up more unit testing related to 'unlimited' usage limits, but the only two usage types that can have unlimited usage currently (and there is no plan to change this) are submissions and storage. We do not currently check plan limits for these usage types on the backend, so there are no code paths for testing the 'unlimited' change in this PR.

Copy link

@jamesrkiger jamesrkiger marked this pull request as draft November 5, 2024 17:58
@jamesrkiger jamesrkiger marked this pull request as ready for review November 6, 2024 13:01
@jamesrkiger jamesrkiger changed the title draft fix(billing): handle string usage limits TASK-1232 fix(billing): handle string usage limits TASK-1232 Nov 6, 2024
@jamesrkiger jamesrkiger requested a review from Guitlle November 6, 2024 13:06
@jamesrkiger jamesrkiger self-assigned this Nov 6, 2024
@jamesrkiger jamesrkiger merged commit 93d8e92 into billing-addons-backend Nov 8, 2024
7 checks passed
@jamesrkiger jamesrkiger deleted the task-1232-handle-string-usage-limits branch November 8, 2024 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants