feat(argument-input): afficher l'erreur 429 (limite quotidienne) et retirer la limite côté client - #262
Open
hboisgibault wants to merge 1 commit into
Open
feat(argument-input): afficher l'erreur 429 (limite quotidienne) et retirer la limite côté client#262hboisgibault wants to merge 1 commit into
hboisgibault wants to merge 1 commit into
Conversation
…de limit The per-position argument limit (argument_side_limit) is now enforced server-side (LogoraAPI, 429). This removes the old client-side mechanism and surfaces the API error to the user. - ArgumentInput: display an error toast when the API returns 429 (daily contribution limit reached); remove the disabledPositions prop, the handleFormSubmit gate and the displayArgumentLimitWarning UI. - SideModal: remove the disabledPositions prop, its warning and the per-position disabled buttons. - Remove the obsolete disabledPositions stories/tests and add a test covering the 429 error toast. Co-authored-by: openhands <openhands@all-hands.dev>
Collaborator
Author
|
🤖 OpenHands est en train de revoir cette PR. Commit head : Ce message a été posté par un agent IA (OpenHands). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objectif
La limite quotidienne de contributions (arguments + réponses) par débat est désormais contrôlée côté serveur (LogoraAPI → réponse 429). Cette PR :
disabledPositions/argument_side_limit), devenu obsolète.Changements
src/components/input/argument_input/ArgumentInput.jsx.catchsur la création de message : si l'API renvoie un 429, un toast d'erreur est affiché (message détaillé renvoyé par l'API, sinon message génériquealert.argument_limit).disabledPositions, le blocage danshandleFormSubmit, et l'avertissementdisplayArgumentLimitWarning(argument_side_limit).src/components/modal/side_modal/SideModal.jsxdisabledPositions, de son avertissement et des boutons de position désactivés.Tests & stories
ArgumentInput.test.jsx: suppression du testdisabledPositions, ajout d'un test qui vérifie l'affichage du toast en cas de 429.SideModal.test.jsx/ stories (ArgumentInput.stories.jsx,SideModal.stories.jsx) : nettoyage des référencesdisabledPositions.Note
Les vérifications client de la limite (dans
LogoraDebate/DebateBody.jsx:messageLimit,getUserArguments,checkDisabledPositions) sont également rendues inutiles par la validation serveur et pourront être nettoyées dans une PR de suivi LogoraDebate.PR API associée : Logora/LogoraAPI#715.
Cette PR a été créée par un agent IA (OpenHands).