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(ai-help): refetch quota after an ai error #10615

Merged
merged 4 commits into from
Mar 1, 2024

Conversation

argl
Copy link
Contributor

@argl argl commented Feb 29, 2024

Summary

(MP-708)

Problem

If we get an error from the OpenAI API, we reinstate the user's quota server side and is not reflected correctly in the UI (input placeholder text)

Solution

We trigger a refetch of the quota information on errors.


How did you test this change?

Manually by running a local rumba server patched with triggering deliberate API errors.

@argl argl changed the title reload quota on ai help error fix(ai-help): refetch quota after an ai error Feb 29, 2024
@argl argl marked this pull request as ready for review February 29, 2024 10:19
@argl argl requested a review from a team as a code owner February 29, 2024 10:19
@github-actions github-actions bot added plus work around features related to MDN Plus plus:ai-help labels Feb 29, 2024
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just one nit.

client/src/plus/ai-help/use-ai.ts Outdated Show resolved Hide resolved
@argl argl requested a review from caugner March 1, 2024 09:41
Copy link
Contributor

@caugner caugner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@caugner caugner merged commit aa6b141 into main Mar 1, 2024
15 checks passed
@caugner caugner deleted the MP-708-quota-update-on-error branch March 1, 2024 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plus:ai-help plus work around features related to MDN Plus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants