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

[PM-17132] Fix rate limiter error message when upgrading organization #13157

Merged
merged 1 commit into from
Feb 3, 2025

Conversation

jonashendrickx
Copy link
Member

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-17132

📔 Objective

When rate limiter is triggered when previewing an organization, an empty error message is being shown. This is due to the fact no translation exists for the rate limiter error message.

📸 Screenshots

Screen.Recording.2025-01-30.at.14.25.48.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@jonashendrickx jonashendrickx requested a review from a team as a code owner January 30, 2025 13:31
Copy link
Contributor

Logo
Checkmarx One – Scan Summary & Details7b010704-151b-42f8-ac9e-9deb1b53ff1c

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Jan 30, 2025

Codecov Report

Attention: Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.

Project coverage is 35.48%. Comparing base (f775e66) to head (7452846).
Report is 23 commits behind head on main.

Files with missing lines Patch % Lines
...ling/organizations/change-plan-dialog.component.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #13157      +/-   ##
==========================================
- Coverage   35.49%   35.48%   -0.01%     
==========================================
  Files        3007     3007              
  Lines       90868    90870       +2     
  Branches    16904    16905       +1     
==========================================
- Hits        32254    32247       -7     
- Misses      56112    56121       +9     
  Partials     2502     2502              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amorask-bitwarden
Copy link
Contributor

It feels off to me that we're raising Toast errors about rate limiting just from a user clicking on Plan cards. I.e if I was the end user, I'd still probably think this was a bug.

Presumably, we only want to even attempt to preview the invoice to calculate the tax if the user's filled out, at least, the country and the postal code, right? Preventing those unnecessary calls here, while not perfect, would resolve this if we expect the user to settle on a specific plan before filling in the final tax information and purchasing.

@jonashendrickx
Copy link
Member Author

It feels off to me that we're raising Toast errors about rate limiting just from a user clicking on Plan cards. I.e if I was the end user, I'd still probably think this was a bug.

Presumably, we only want to even attempt to preview the invoice to calculate the tax if the user's filled out, at least, the country and the postal code, right? Preventing those unnecessary calls here, while not perfect, would resolve this if we expect the user to settle on a specific plan before filling in the final tax information and purchasing.

It only attempts to calculate the sales tax when both postal code and country are entered.

I also added a delay when typing so it doesn't unnecessarily try to recalculate the sales tax when modifying the country or postal code.

I think the scenario above rarely happens. But we should probably always get a translation key back from the backend instead of text.

@jonashendrickx jonashendrickx added the needs-qa Marks a PR as requiring QA approval label Jan 30, 2025
@amorask-bitwarden
Copy link
Contributor

It feels off to me that we're raising Toast errors about rate limiting just from a user clicking on Plan cards. I.e if I was the end user, I'd still probably think this was a bug.
Presumably, we only want to even attempt to preview the invoice to calculate the tax if the user's filled out, at least, the country and the postal code, right? Preventing those unnecessary calls here, while not perfect, would resolve this if we expect the user to settle on a specific plan before filling in the final tax information and purchasing.

It only attempts to calculate the sales tax when both postal code and country are entered.

I also added a delay when typing so it doesn't unnecessarily try to recalculate the sales tax when modifying the country or postal code.

I think the scenario above rarely happens. But we should probably always get a translation key back from the backend instead of text.

My mistake I missed that you had those fields entered in your video. So this was basically someone having entered all their information and then going and toggling the plans quickly. Yeah, I mean it's definitely an edge-case, but something I suggest we look into potential caching mechanisms for in the near future. This looks good tho.

@jonashendrickx jonashendrickx removed the needs-qa Marks a PR as requiring QA approval label Feb 3, 2025
@jonashendrickx jonashendrickx merged commit 2003766 into main Feb 3, 2025
40 of 41 checks passed
@jonashendrickx jonashendrickx deleted the PM-17132 branch February 3, 2025 15:16
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.

2 participants