fix(calendar): show in-flight state on Save, and surface the silent length-guard rejection - #921
Open
texchi2 wants to merge 2 commits into
Open
fix(calendar): show in-flight state on Save, and surface the silent length-guard rejection#921texchi2 wants to merge 2 commits into
texchi2 wants to merge 2 commits into
Conversation
…ngth-guard rejection
…ngth-guard rejection
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.
Follow-up to #888 / #887. That PR fixed the crash in the calendar Save path (
crypto.randomUUIDon insecure origins); this one fixes the two places where the same dialog gives the user no
feedback at all, which is what made the crash present as "the Save button is dead".
Both are still reproducible on
maintoday.1. Save has no in-flight state
handleSaveisasync, and the button is disabled whileisSaving— but nothing on screenchanges. On a slow link (mobile, VPN, a self-hosted server over a tunnel) the button simply stops
responding for the full duration of the request, which reads as a dead button and invites repeat
clicks.
disabledprevents the double-submit, so this is a feedback bug rather than a data bug —but "nothing happened" is the reason users click again.
Fix:
{isSaving ? t("form.saving") : t("form.save")}, plus the missingcalendar.form.savingkey. (
calendar.formhad nosaving; thesavingkey that exists elsewhere incommon.jsonisin a different namespace.)
2. The length guard returns silently
A save rejected here produces no toast, no field error, no dialog change — indistinguishable from
case 1. The inputs also enforce these limits via
maxLength, so this is a backstop that shouldrarely fire; when it does, it should say so. Fix:
toast.error(t("notifications.event_error"))before the return, using the key that already exists.
Notes
notifications.event_erroralready exists; onlycalendar.form.savingis added, English only —happy to leave it for translators or add other locales if you prefer.
also how Create-event dialog reports failure although CalendarEvent/set succeeds (Stalwart 0.16.18) — duplicates on retry #887 surfaced. Happy to adjust the wording or drop the code comments if you'd rather
keep the file comment-free.