You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Adding an annotation loses the draft when the save request fails #44809
I have searched for existing issues describing this problem.
I have read the contribution guidelines.
Environment
Dify frontend on main (c28e136be0), application annotations page.
Steps to reproduce
Open an application's Annotations page and choose Add Annotation.
Enter a question and reply.
Make POST /apps/{app_id}/annotations fail, for example by blocking the request in browser developer tools.
Select Add. Repeat with Add another annotation reply selected.
Actual behavior
The submission handler catches the rejection and then runs the success cleanup anyway: the panel closes, or both fields are cleared when continuous creation is selected. The draft is lost even though the annotation was not saved. Closing remains available during submission.
Expected behavior
Keep the panel and draft available after a failed save, show a recoverable error, and reset or close only after success. Pending submissions should prevent duplicate creation and dismissal. Continuous creation should retain its preference, clear only the saved fields, and focus the question for the next entry.
Proposed scope
Use the existing positioned Dialog primitives for this modal form, retaining its right-side placement and question/reply avatars. Keep submission state with the dialog, use the generated annotation mutation and shared cache invalidation, and cover validation, retries, pending interactions, and continuous creation.
Activity