Repository navigation
fix: address 16 verified bugs from Faultmark report (#2829) - #1
Merged
Merged
Conversation
## Description Updated HIPAA status to compliant
Reject disposable / throwaway email providers (mailinator, yopmail, 10minutemail, ...) across all signup paths: email/password, Google, Microsoft, personal OIDC and organisation OIDC. Backed by the mailchecker package (offline, ~55k domains, subdomain-aware). Exposes a SIGNUP_DISPOSABLE_EMAIL error code so the signup form and SSO redirect alert can show a dedicated message instead of the generic 'signup disabled' one.
Apply fixes for the still-present bugs from the Faultmark scan: - Bug #7: document-edit-form localStorage cleanup was skipping every other key because it removed items while forward-iterating the index. Collect keys first, then remove. - Bug documenso#8: envelope signer page renderer was destroying the loading spinner in .finally() while the SIGNATURE field's re-auth dialog was still open (executeActionAuthProcedure resolves synchronously after opening). Move spinner teardown into onReauthFormSubmit and the non-auth branch so it only runs after the sign actually completes. - Bug #9: security.sessions columns useMemo had empty deps but captured t, session, and refetch. Add them to the dependency array. - Bug documenso#10: replace module-level UAParser instance (mutated across renders) with a per-cell `new UAParser(userAgent).getResult()` call. - Bug documenso#11: sanitize site-banner HTML with isomorphic-dompurify before passing to dangerouslySetInnerHTML. - Bug documenso#12/documenso#13: include signingOrder in the useCallback dep arrays for handleSigningOrderChange and onDragEnd so they don't close over a stale ordering mode. - Bug documenso#14: field duplication now uses lastActiveField.signerEmail and recipientId unconditionally instead of preferring the currently selected recipient — duplicates were being re-assigned away from the field owner. - Bug documenso#15: Math.max($page.offsetHeight, DEFAULT_HEIGHT_PX) and matching width; the previous single-arg Math.max calls dropped the page-size source entirely. - Bug documenso#18: AppCommandMenu toggleOpen now computes newOpen once instead of passing the stale outer-scope isOpen to onOpenChange. - Bug #19: goToDocuments/goToTemplates guard for empty link arrays so the shortcuts no longer throw when teamUrl is null. - Bug documenso#20: public-profile-template-manage-dialog step calculation reads the freshly-derived newSelectedId rather than the (still-stale) selectedTemplateId state. - Bug documenso#21: editor-field-radio-form computes the full final state and writes once instead of two sequential setValue calls that could briefly leave the previous option still checked. - Bug documenso#22: team-delete-dialog forwards transferTeamId only when > 0, so the "Don't transfer" sentinel value of -1 is converted to undefined. - Bug documenso#23: document-signing-number-field auto-sign effect adds onSign to its dep array so the captured closure stays in sync with the form state. - Bug documenso#24: org teams settings effect now early-returns when the rebuilt URLSearchParams matches the current one, breaking the setSearchParams → searchParams change → effect re-runs loop. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
…th auth dialog The previous approach replaced .finally() with .catch(), which meant the spinner was never destroyed if the auth dialog was dismissed by the user (cancel/close) — the onReauthFormSubmit callback is only invoked on successful auth submission. The correct approach: - Keep .finally() as the safety net for dialog cancel + error cleanup - Use destroySpinnerOnce() guard to ensure the spinner is only destroyed once, even if both onReauthFormSubmit and .finally() fire - Keep the spinner alive during the auth dialog (destroyed only inside onReauthFormSubmit after signField completes, not prematurely)
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
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.
Closes documenso#2829.
Went through the Faultmark report and fixed 16 issues. Most were straightforward — stale deps, missing guards, things that break under specific conditions but feel obvious once you see them. A couple were worth explaining.
Bug documenso#8 — spinner destruction timing
This one took a second look. The report flagged
destroy()being called twice on the signature field's Konva spinner group. That was misleading — the real problem is more subtle. When the user needs to reauthenticate (2FA, passkey), the original code calleddestroy()in.finally()which fires immediately after the auth dialog opens. So the spinner vanishes while the dialog is still on screen. ThenonReauthFormSubmitfires later and callsdestroy()again on an already gone group.Claude's first fix replaced
.finally()with.catch(), but that introduced a leak — if the user cancels the auth dialog, the spinner never gets cleaned up and sits there on the canvas forever since the field is already signed.The fix: a
destroySpinnerOnceguard. BothonReauthFormSubmitand.finally()call it, but only the first call actually runs. This keeps the spinner visible during auth (correct UX) and cleans up on cancel (no leak).The other 15 fixes sorted by category:
dangerouslySetInnerHTMLapp-banner.tsxuseMemo/useCallbacksecurity.sessions.tsx,configure-document-recipients.tsx,document-signing-number-field.tsxselectedTemplateIdin callbackpublic-profile-template-manage-dialog.tsxisOpenfrom nested stateapp-command-menu.tsxv.openfrom the loop was being read staleteamUrlcould be nullapp-command-menu.tsxtransferTeamIdcould be -1team-delete-dialog.tsxMath.max()with single argumentconfigure-fields-view.tsxfor...ofonStorage.key()with mutationdocument-edit-form.tsxconfigure-fields-view.tsxfield.onChangeandform.setValueeditor-field-radio-form.tsxnew UAParser()across cell renderssecurity.sessions.tsxo.$orgUrl.settings.teams.tsxsetSearchParamsinuseEffecttriggered itselfMade sure nothing was already addressed upstream before touching it.