Skip to content

fix: use functional update in setSearchParams to prevent infinite re-render loop - #2868

Merged
Mythie merged 8 commits into
documenso:mainfrom
durgeshhhhhhh:fix/searchparams-infinite-rerender
Sep 11, 2026
Merged

Mythie merged 8 commits into
documenso:mainfrom
durgeshhhhhhh:fix/searchparams-infinite-rerender

Conversation

@durgeshhhhhhh

@durgeshhhhhhh durgeshhhhhhh commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Description

When searchParams is included in the useEffect dependency array, each setSearchParams call produces a new searchParams object reference, re-triggering the effect and causing an infinite re-render loop.

The issue suggested an early return guard as a fix, but the effect would still run unnecessarily on every searchParams change. Instead, I used the functional update pattern setSearchParams((prev) => {...}) which removes searchParams from the dependency array entirely, breaking the loop at the root cause.

Related Issue

Part of #2829

Changes Made

  • Replaced direct searchParams usage inside useEffect with functional update pattern setSearchParams((prev) => {...})
  • Removed searchParams from the useEffect dependency array
  • Used prev instead of searchParams to build updated params, ensuring
    always-fresh value without creating a dependency

Copilot AI review requested due to automatic review settings May 26, 2026 08:49
@vercel

vercel Bot commented May 26, 2026

Copy link
Copy Markdown

@durgeshhhhhhh is attempting to deploy a commit to the Documenso Team Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 26, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are limited based on label configuration.

🏷️ Required labels (at least one) (1)
  • coderabbit

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: f45915fb-ef56-446b-af0c-438141adf93d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@vercel

vercel Bot commented May 26, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

3 Skipped Deployments
Project Deployment Actions Updated
prd-docs Ignored Ignored Sep 11, 2026 8:03am UTC
prd-openpage-api Ignored Ignored Sep 11, 2026 8:03am UTC
stg-docs Skipped Skipped Sep 11, 2026 8:03am UTC

Request Review

@vercel
vercel Bot temporarily deployed to Preview – stg-docs May 26, 2026 08:49 Inactive

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Updates the teams settings route to use a functional setSearchParams update when applying the debounced search query, reducing reliance on the captured searchParams value.

Changes:

  • Switches from constructing params off searchParams to using the functional setSearchParams(prev => ...) form.
  • Simplifies the query param set/delete logic inside the updater.
  • Adjusts useEffect dependencies to remove searchParams and avoid stale captures.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +25 to +36
setSearchParams((prev) => {
const params = new URLSearchParams(prev?.toString());

if (debouncedSearchQuery === '') {
params.delete('query');
} else {
params.set('query', debouncedSearchQuery);
}

return params;
});
}, [debouncedSearchQuery, pathname]);
@dguyen

dguyen commented May 27, 2026

Copy link
Copy Markdown
Collaborator

Hi, do you have steps to replicate this issue?

@vercel
vercel Bot temporarily deployed to Preview – stg-docs May 28, 2026 08:29 Inactive
@durgeshhhhhhh

durgeshhhhhhh commented May 28, 2026 •

Copy link
Copy Markdown
Contributor Author

Hi @dguyen, Here are the steps to replicate:

  1. Navigate to /o/{org-url}/settings/teams
  2. Open React DevTools → Profiler tab
  3. Start recording
  4. Type "hello" in the search input
  5. Stop recording

Without fix: 65+ re-renders observed for 5 keystrokes
With fix: ~16 re-renders for same input

Root Cause:

searchParams is included in the useEffect dependency array. Each setSearchParams call produces a new searchParams object reference, re-triggering the effect in a loop.

Buggy code:

useEffect(() => {
  const params = new URLSearchParams(searchParams?.toString());
  params.set('query', debouncedSearchQuery);
  if (debouncedSearchQuery === '') {
    params.delete('query');
  }
  setSearchParams(params);
}, [debouncedSearchQuery, pathname, searchParams]);

I also checked the Sibling files and found they have an early return guard to prevent this, but this file was missing it, causing an infinite loop.

I have two possible fixes :

  1. Early return guard (used in sibling files):
if (params.toString() === searchParams?.toString()) return;

This stops the loop, but the effect still reruns unnecessarily on every searchParams change, resulting in 2 renders per keystroke.

  1. Functional update pattern (My fix):
useEffect(() => {
  setSearchParams((prev) => {
    const params = new URLSearchParams(prev?.toString());
    if (debouncedSearchQuery === '') {
      params.delete('query');
    } else {
      params.set('query', debouncedSearchQuery);
    }
    return params;
  });
}, [debouncedSearchQuery, pathname]);

I chose option 2 because prev always provides a fresh value directly from React, eliminating the need for searchParams in the dependency array entirely and preventing the stale closure issue. Effect only runs when debouncedSearchQuery or pathname changes, breaking the loop at the root cause and keeping renders minimal, making the application more efficient.

@vercel
vercel Bot temporarily deployed to Preview – stg-docs May 29, 2026 03:54 Inactive
@durgeshhhhhhh

Copy link
Copy Markdown
Contributor Author

HI @dguyen, if you get a chance, review the PR and let me know if anything needs to be changed. Also, if you approve this approach, I would like to discuss applying the same functional update pattern to the sibling files as well for consistency and efficiency

@vercel
vercel Bot temporarily deployed to Preview – stg-docs May 30, 2026 18:33 Inactive
@vercel
vercel Bot temporarily deployed to Preview – stg-docs June 12, 2026 12:34 Inactive
@gitguardian

gitguardian Bot commented Jun 12, 2026 •

Copy link
Copy Markdown

️✅ There are no secrets present in this pull request anymore.

If these secrets were true positive and are still valid, we highly recommend you to revoke them.
While these secrets were previously flagged, we no longer have a reference to the
specific commits where they were detected. Once a secret has been leaked into a git
repository, you should consider it compromised, even if it was deleted immediately.
Find here more information about risks.


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

@github-actions

Copy link
Copy Markdown
Contributor

This PR has not seen activitiy for a while. It will be closed in 30 days unless further activity is detected.

@github-actions github-actions Bot added the Stale label Sep 10, 2026
@vercel
vercel Bot temporarily deployed to Preview – stg-docs September 11, 2026 05:40 Inactive
@vercel
vercel Bot temporarily deployed to Preview – stg-docs September 11, 2026 08:03 Inactive
@github-actions github-actions Bot removed the Stale label Sep 11, 2026
@Mythie
Mythie merged commit 20ae849 into documenso:main Sep 11, 2026
12 of 13 checks passed
@Mythie

Mythie commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Cheers

@durgeshhhhhhh

Copy link
Copy Markdown
Contributor Author

Hey @Mythie ,

First of all, cheers brother

And thanks! I’m really glad you understood my approach and merged the PR. I really appreciate the review and the opportunity to contribute!

Xusifob added a commit to instamedsolutions/documenso that referenced this pull request Nov 23, 2026
* fix(ui): direct signing templates window layout (documenso#2909)

* fix(i18n): mark Bio string for translation (documenso#2910)

* fix: add email reporting (documenso#2918)

* chore: extract translations (documenso#2919)

* fix: add org insight document complete stat (documenso#2920)

* chore: add translations (documenso#2922)

* fix: update org stats table ui (documenso#2924)

* docs(embedding): document iframe URL fragment options (documenso#2915)

* feat: add header metadata to emails (documenso#2927)

* fix: add email disable flag (documenso#2931)

* fix: add multi email transport system (documenso#2942)

* chore(i18n): fix typo in Polish translation (documenso#2948)

* docs: add registration form screenshot to create account page (documenso#2908)

* fix: update link-only notification settings (documenso#2821)

* fix: update new quota and rates UX (documenso#2954)

* docs: clarify email verification instructions for free and paid plans (documenso#2959)

* fix: guard missing password reset token and fix broken reset link URL (documenso#2928)

* fix: point Railway deploy button at the working template URL (documenso#2962)

* fix: ensures new expire on setSessionCookie (documenso#2708)

* fix: exclude rejected documents from inbox count (documenso#2893)

* chore: update docs trusted emails (documenso#2964)

* chore: extract translations (documenso#2923)

* feat: allow changing field types (documenso#2873)

* fix: load typed signature font on profile page (documenso#2963)

* feat: enhance document signing page with field canvas style integration (documenso#2876)

* fix: correctly strip background job values (documenso#2965)

* chore: add translations (documenso#2929)

* fix: link signing brand logos (documenso#2881)

* fix: correctly orphan envelopes and stripe cancel on delete (documenso#2967)

* chore: update verify email docs (documenso#2970)

* fix(i18n): add space between tag and text (documenso#2972)

* fix: rework stripe webhooks into idempotent subscription sync (documenso#2977)

Replace per-event webhook handlers with a single sync function that
fetches the current state from Stripe and converges the local
subscription, claim, and organisation type.

- Create organisations upfront before checkout, restricted as
  "pending payment" until the first payment syncs
- Add rate-limited subscription sync route, triggered on checkout
  success so the UI doesn't wait on webhooks
- Surface pending payment state in banner, billing table, and limits

* fix: use correct property for embed edit editor config (documenso#2985)

* chore: add translations (documenso#2975)

* fix: reconcile billing when stripe subscription is missing (documenso#2988)

Catch resource_missing in the subscription route, return null so the
billing page still loads, and fire a sync to converge the stale row.

* fix: add early quota warning (documenso#2986)

## Description

- Add banners when plans near fair use limits
- Automated email alerts to our support when nearing fair use limits

* v2.12.0

* feat: add CSC AES/QES signing (v1 instance-wide config) (documenso#2874)

Adds Cloud Signature Consortium (CSC) integration for AES/QES signing
against a configured TSP. v1 ships as instance-wide configuration via
environment variables, with per-envelope signature level selection,
license gating, and an OAuth-driven signing flow (capture + FIFO
signers, SAD session, blocking/in-progress recipient pages).

Includes signature level compatibility checks (role, signing order,
dictate next signer), envelope mutability assertions, Prisma migration
for signature level and CSC tables, and docs for the new signing
certificate options.

* feat: add cancellable document status (documenso#2992)

Adds a CANCELLED envelope status that privileged members (owner or team
admin/manager) can move a pending document into. Sending recipient
notifications via a background job while retaining the document in the
dashboard as proof of distribution.

Includes a dedicated Cancelled tab, single and bulk cancel actions,
the ENVELOPE_CANCELLED mutability guard, and e2e coverage for
permissions
and visibility.

* fix: include envelopeId in webhook payload (documenso#2998)

* v2.13.0

* fix: improve team member removal ux (documenso#3001)

* fix: only send S3 checksums when required to support S3-compatible storage (documenso#2984)

* fix: render unicode characters in typed signatures (documenso#2728)

* fix: signing request email renders blank when organisation/team branding is enabled (documenso#2968)

* fix: remove old dialogs (documenso#3006)

* feat: add custom brand colours to emails (documenso#3005)

* feat: allow additional envelope duplicate settings (documenso#3008)

* fix: respect branding enabled for recipient routes (documenso#3009)

* chore: extract translations (documenso#2987)

* fix: correctly use default distribute envelope tab (documenso#3010)

* fix: set send status on resend (documenso#3011)

* feat: add API endpoint to reject documents on behalf of recipients (documenso#3007)

Programmatically record an external rejection on behalf of a recipient
who declined outside the platform. Flags the rejection as external in
the audit log, optionally attributes it to a specific team member via
actAsEmail, and enforces team membership and document visibility.

* feat: cap automated reminders before resend (documenso#3016)

Stop sending automated reminders after a configurable threshold
(default 5) and reset the count on manual resend.

* fix: show warning on overlapping fields (documenso#3017)

* chore: add translations (documenso#3012)

* chore(i18n): update Polish translation (documenso#3020)

* fix: migrate emails to jobs (documenso#3024)

* chore: general repo maintenance and docs cleanup (documenso#3030)

Refresh README/docs for the current stack, add a security policy,
note the external-PR pause, and remove dead config and workflows.

* feat: add API endpoints for downloading certificate and audit log PDFs (documenso#3025)

Add V2 API routes to download an envelope's certificate and audit log
separately, and align the internal cert/audit log downloads to use
envelopeId.

Enforces document visibility via getEnvelopeWhereInput and loads field
signatures so certificates render correctly.

* fix: resolve permission issues (documenso#3029)

* chore: add tests for cert and audit log download via api (documenso#3043)

* v2.14.0

* fix: auto select field on drop (documenso#3028)

* feat: add field multiselect (documenso#3031)

* fix: invite email placeholder (documenso#3045)

- **fix: interpolate inviterEmail in invite email mailto link**
- **fix: add alt attributes to email template images**

* fix: tighten permission and validation checks (documenso#3046)

* fix: scope organisation group deletion (documenso#3047)

* fix: add missing teams branding guard (documenso#3049)

* fix(email): render Preview inside Body across all email templates (documenso#3004)

* fix: add additional team group permission checks (documenso#3052)

* fix: french translation for confirmation message (documenso#3050)

* feat: add granular signin disable flags and OIDC auto-redirect (documenso#2857)

* fix: webhook payload contains stale deletedAt on document cancellation (documenso#2980)

* fix: add sticky form update button (documenso#3056)

* chore: extract translations (documenso#3013)

* chore: upgrade libpdf (documenso#3058)

* fix: remove presigned branding upload (documenso#3053)

* fix: block invisible & control characters and URLs in names (documenso#2978)

* fix: admin organisation limits and usage UI (documenso#3014)

* chore: upgrade deps (documenso#3065)

* Add "Apply Your License Key" self-hosting guide (documenso#3077)

Adds a dedicated self-hosting page documenting how to apply an
Enterprise license key, and cross-links it from the related docs.

New page: self-hosting/configuration/license.mdx — "Apply Your License
Key"
Set NEXT_PRIVATE_DOCUMENSO_LICENSE_KEY (Docker Compose / docker run /
.env tabs)

* feat: enable real-time validation for email and password fields (documenso#2204)

## Description

This MR improves the real-time validation experience on the signup page.
Currently, both the email and password fields validate only on blur,
causing users to continue seeing error messages even after correcting
their input until they click outside the field.

This update switches the React Hook Form configuration from mode:
'onBlur' to mode: 'onChange', ensuring validations update immediately as
the user types.
This results in a smoother and less confusing signup experience.

## Related Issue

Fixes documenso#2200

## Changes Made

- Updated React Hook Form configuration in the signup form from:
- mode: 'onBlur' ➜ mode: 'onChange'
- Ensures real-time validation for email and password fields
- No schema or logic changes — only validation trigger updated


## Testing Performed

- Manually tested the signup page for:
- Real-time password rule updates
- Real-time email validation feedback
- Error disappearance immediately after correcting input

## Checklist

- [x] I have tested these changes locally and they work as expected.
- [ ] I have added/updated tests that prove the effectiveness of these
changes.
- [x] I have updated the documentation to reflect these changes, if
applicable.
- [x] I have followed the project's coding style guidelines.
- [x] I have addressed the code review feedback from the previous
submission, if applicable.

## Additional Notes

This is a small UX-focused improvement; the validation schema remains
unchanged.

Co-authored-by: Catalin Pit <[email protected]>

* docs: update rate limit doc for organisation limit for self hosters (documenso#3089)

* v2.15.0

* chore: extract translations (documenso#3060)

* fix: replace tailwind class typos

* fix: improve editor autosave (documenso#3057)

* fix(ui): improve destructive button contrast in dark mode (documenso#3071)

* fix: missing noreply email for resend (documenso#3094)

* chore: deps upgrade 2026-07-14 (documenso#3095)

* feat: redesign api tokens settings page (documenso#3076)

* fix: react hydration errors (documenso#3099)

Move PostHog init out of the React tree so the client tree matches
the server render (mismatched useIds could abort hydration, leaving
dead event handlers). Also expose the CSP nonce so Radix scroll-lock
styles aren't blocked.

* fix: render error messages for invalid templates (documenso#3088)

Currently direct templates can be created without the required
signatures fields for signers.

This means that the document can be fully signed by everyone but will
ultimately fail the sealing step which leaves the document in an
unrecoverable state.

* feat: add document preferences reset dialog (documenso#3039)

* feat: add branding preferences reset dialog (documenso#3032)

* v2.16.0

* fix: increase global API rate limits to 1000/min (documenso#3081)

* chore: deprecate endpoints (documenso#3022)

* fix: update stripe team member billing (documenso#2991)

* feat: rework command search (documenso#3109)

* fix: sort CC recipients last (documenso#2930)

* feat: add copy button for license key in admin panel (documenso#3123)

## Description

Adds a copy button next to the show/hide toggle for the license key in
the admin panel license card (Admin Panel → Stats).

- Ghost button matching the existing eye-toggle styling (`h-6 w-6`,
`CopyIcon`)
- Uses the standard `useCopyToClipboard` + toast pattern (same as
`template-direct-link-badge.tsx`)
- Copies the key regardless of masked/visible state

New translation strings will be picked up by the next `chore: extract
translations` run.

## Before / After

![Before and after: copy button added next to the license key show/hide
toggle](https://artifacts.duncan.land/documenso-pr3123-license-copy)

> Screenshots taken against a locally mocked ACTIVE license (the mock is
not part of this PR).

## Testing

- `npx tsc --noEmit -p apps/remix` clean
- `biome check` clean
- Smoke-tested in browser: clicking the button fires the "Copied to
clipboard" toast (visible in the screenshot above)

* feat: rejected and expired recipient filters (documenso#2889)

* docs(webhooks): correct retry policy, timeout and payload reference (documenso#3132)

## Description

Corrects the webhooks documentation, which described delivery behavior
that does not exist in the implementation.

## Changes Made

- Replaced the fabricated retry schedule (5 attempts / immediate-to-2h
backoff) with the real provider-dependent behavior: retries belong to
the job provider (`NEXT_PRIVATE_JOBS_PROVIDER`) — local (default) 4
total attempts back-to-back, BullMQ 3 attempts with exponential backoff
from 1s, Inngest 5 attempts with platform backoff.
- Fixed the webhook timeout from 30 seconds to 10 seconds
(`WEBHOOK_TIMEOUT_MS = 10_000`, hard abort).
- Clarified failure semantics: non-2xx fails, 3xx redirects are not
followed (`redirect: 'manual'`), network/SSRF-blocked calls record
response code 0; failed deliveries mark only the `WebhookCall` record —
the webhook itself is never auto-disabled.
- Corrected URL requirements: `http://` is accepted; documented the SSRF
guard (private/loopback blocked,
`NEXT_PRIVATE_WEBHOOK_SSRF_BYPASS_HOSTS` bypass for self-hosters).
- Added `envelopeId` to both field tables and all payload/recipient JSON
examples; framed numeric `id` as the legacy v1 identifier.
- Removed a documented `documentMeta` field that exists in neither the
Zod schema nor Prisma; fixed timezone/dateFormat examples to the
hardcoded `Etc/UTC` / `yyyy-MM-dd hh:mm a` values.
- Added missing `REJECTED`/`CANCELLED` statuses and
`TEMPLATE_DIRECT_LINK` source; fixed `templateId` to `null` on
TEMPLATE_* examples; documented the previously missing
`RECIPIENT_EXPIRED` event across setup, events, and verification pages.

## Testing Performed

Docs-only change. Every claim verified against the implementation
(`execute-webhook-call.ts`, job clients, `webhook-payload.ts`,
`assert-webhook-url.ts`, webhook-router schema).

* feat: bulk download documents (documenso#2711)

* feat: replace document status tabs with filter pills (documenso#3145)

Swaps the tab row and dropdowns for faceted filter pills (status,
sender, period) with a shared reset, and moves URL param handling
to nuqs.

<img width="2198" height="1674" alt="image"
src="https://github.com/user-attachments/assets/6996431c-09c8-45c3-bc30-f0a1e503c941"
/>

* fix: add logging for errors on sign or complete (documenso#3149)

* fix: add more logging for errors on sign or complete (documenso#3151)

* feat: unify settings (documenso#3128)

* fix: handle completion when already signed (documenso#3159)

Previously attempting to complete a document which is already completed
you'd get a generic error toast. Now when completing a document that you
have already completed you are redirected to the completed page.

Handles cases where two mutations managed to fire racing eachother.

* fix: improve unified settings (documenso#3160)

* fix: restore overriden translations (documenso#3161)

* chore: extract translations (documenso#3163)

* feat(remix): support serving app under a sub-path via NEXT_PUBLIC_BASE_PATH (documenso#2824)

* feat: show feature gated setting pages (documenso#3167)

* chore: update Polish translations (documenso#3210)

* fix: docker healtcheck (documenso#3176)

* fix: use documenso fork of skia-canvas for rendering (documenso#3214)

Use our fork of `skia-canvas` for rendering which handles
encoding characters correctly with the caveat font and other
similar fonts that can group glyphs like ligatures.

This resolves issues with pdf text extraction where characters
were unable to be extracted due to lacking any data within the cmaps.

* feat: migrate to react 19 (documenso#3107)

* chore: remove planning skills (documenso#3177)

* chore: deps 2026-08-17 (documenso#3225)

* chore: add github action timeouts (documenso#3228)

* fix: surface actionable errors when completing documents (documenso#3229)

* feat(ui): redesign recipient field hover card (documenso#3070)

Redesigns the popover shown when hovering a recipient field avatar in
the envelope view.

- Field-first hierarchy: header shows field-type icon + "{Type} field"
with inline status (Signed/Pending/Read Only) as a colored dot + label
- Recipient (name/email) moved to a recessed footer well as secondary
context
- Hide-field action moved from floating over the text to a ghost icon
button in the footer well
- Added a `FieldType` → icon map mirroring `field-selector.tsx`

## Screenshots

| Before | After |
| --- | --- |
| <img
src="https://raw.githubusercontent.com/ephraimduncan/documenso/assets-pr-3070-hover-card/.github/assets/hover-before.png"
width="320" alt="Previous hover tooltip: centered badge, title and
recipient text" /> | <img
src="https://raw.githubusercontent.com/ephraimduncan/documenso/assets-pr-3070-hover-card/.github/assets/hover-after.png"
width="320" alt="New hover card: field-first header with status,
recipient footer well" /> |

* docs(api): document rate limit headers and 429 variants (documenso#3133)

## Description

The rate limits page claimed "No rate limit headers are currently
provided" and advised a fixed 60-second wait. The middleware has been
setting standard headers on every API response.

## Changes Made

- Documented `X-RateLimit-Limit`, `X-RateLimit-Remaining`, and
`X-RateLimit-Reset` (Unix epoch seconds) on every `/api/v1`, `/api/v2`,
and `/api/v2-beta` response, and `Retry-After` (seconds, min 1) on 429s.
- Explained that windows are fixed epoch-aligned 1-minute buckets, so
the real wait is 1–60s — clients should honor `Retry-After` instead of
sleeping a fixed 60s.
- Showed both 429 body shapes: the global per-IP limiter's `{ "error":
... }` vs AppError-based `code`/`message`/`statusCode`.
- Covered the three distinct 429 sources: global per-IP limit,
organisation windowed limits, and monthly envelope quota (which sends no
rate-limit headers).
- Added `/api/v2-beta/*` to the documented scope; left the
verified-correct 1000/min figure and plan-limits table untouched.

## Testing Performed

Docs-only change. Verified against `rate-limit-middleware.ts`,
`rate-limit.ts`, `check-organisation-rate-limits.ts`,
`check-monthly-quota.ts`, and the remix server router.

* docs(trpc): add openapi descriptions to envelope cancel, delete and update routes (documenso#3134)

## Description

The envelope cancel, delete, and update routes rendered without
descriptions in the generated OpenAPI reference.

## Changes Made

- Added route-level OpenAPI `description` to `cancel-envelope.types.ts`,
`delete-envelope.types.ts`, and `update-envelope.types.ts`.
- Added field-level `.describe()` calls on request schemas, matching the
style of sibling envelope-router schemas (e.g.
`get-envelopes-by-ids.types.ts`, `distribute-envelope.types.ts`).

## Testing Performed

`npx tsc --noEmit -p packages/trpc` passes with no errors. Metadata-only
change — no runtime behavior affected.

* docs(api): document cancel endpoint and fix get-many body shape (documenso#3135)

## Description

Documents API page: adds the missing Cancel Document section and fixes a
fabricated request body on get-many that would fail schema validation
for anyone copying the docs.

## Changes Made

- Added a `## Cancel Document` section: `POST /envelope/cancel` with `{
envelopeId, reason? }`, PENDING-only (400 otherwise), not idempotent,
two-stage access (404 if not visible, 401 without owner/MANAGER+), fires
`DOCUMENT_CANCELLED` webhook, emails only SENT/OPENED non-CC
non-rejected recipients.
- Replaced the fabricated `envelopeIds: [...]` get-many body with the
real nested selector: `{ "ids": { "type": "envelopeId" | "documentId" |
"templateId", "ids": [...] } }` (string[] for envelopeId, number[]
otherwise, 1–20 IDs).
- Added the missing `### Response` for get-many (`{ "data": [...] }`)
and documented silent filtering of inaccessible IDs (no 404).
- Added `CANCELLED` to the status table, mermaid state diagram,
transitions prose, and filter values.
- Removed the nonexistent `source: "API"` value (real enum: `DOCUMENT |
TEMPLATE | TEMPLATE_DIRECT_LINK`).
- Fixed fabricated `pagination` wrappers to the real flat shape `{ data,
count, currentPage, perPage, totalPages }`; fixed Field `id` type and
mismatched code fences.
- Migration guide: warned that get-many's body shape changed from
`documentIds: number[]` — the breaking part of that migration.

## Testing Performed

Docs-only change (plus the migration guide). Verified against the
envelope-router types, `cancel-document.ts`, the cancel e2e spec, and
`schema.prisma`.

* v2.17.0

* fix: add type button to multiselect remove and clear buttons (documenso#3256)

* fix(i18n): add Plural support for bulk download limit alert (documenso#3209) (documenso#3260)

* fix(i18n): add plural forms for command menu results and item counts (documenso#3207) (documenso#3262)

* fix(emails): remove trailing period from document pending email subject (documenso#3213)

* feat: allow admin recipient search (documenso#3277)

* feat: last used column for api tokens (documenso#3230)

* refactor(trpc): use ts-pattern for envelope document-data resolution (documenso#3222)

* chore: extract translations (documenso#3171)

* fix: allow zooming and dragging uploaded signatures (documenso#3173)

* fix: render adjacent email template variables correctly (documenso#3153)

* feat: optimise posthog usage and add error tracking (documenso#3301)

Disable autocapture and person profiles for anonymous users, and
redact signing tokens from captured URLs.

Manually wire exception capture into the signing, editor and embed
flows with recipient/envelope context for debugging recipient-reported
issues.

Track activation events (webhooks, api tokens, direct links, embed
sessions) server-side with org attribution, and drop client events
already tracked in-app.

* chore: add provider request template (documenso#3311)

* chore: update Polish translation (documenso#3316)

* fix: prevent dialogs from closing on blur (documenso#3314)

* fix: enlarge envelope field resize handle hit area (documenso#3315)

* docs: clarify team API token and certificate behavior (documenso#3317)

* chore: upgrade libpdf (documenso#3323)

* fix: add patches back to dockerfile (documenso#3324)

* fix: default unset signing transport to local (documenso#3309)

`/api/health` and `/api/certificate-status` reported the cert as
available when `NEXT_PRIVATE_SIGNING_TRANSPORT` was unset, even though
sealing defaults to the local P12 and fails if it is missing,
unreadable, or expired.

* fix: increase signature placeholder size when a timestamp authority is configured (documenso#3328)

* chore: upgrade to node 24 lts and clean up docker image (documenso#3332)

Upgrade to Node 24 LTS, using the alpine 3.23 tag to handle issues with
streaming zip files on 24.16 which hangs npm ci.

Pin npm to 11.19.1 for min-release-age-exclude support.

Slim the runner image by dropping dev deps, the react-email CLI, and
esbuild,
none of which run in production.

Install turbo from the lockfile version instead of a hardcoded one.

* fix: temporary fix for British to US spelling (documenso#3329)

* fix: block SSRF via IPv4-mapped IPv6 webhook URLs (documenso#2901) (documenso#3166)

* fix: improve invalid bulk template upload error handling (documenso#3326)

* fix: use react router middleware (documenso#3351)

* chore(ui): remove unused text fitting component (documenso#3337)

* fix: resolve build errors (documenso#3352)

* chore(auth): remove commented account creation code (documenso#3344)

* v2.18.0

* fix: pass csp nonce to @hello-pangea/dnd style elements (documenso#3354)

* fix(i18n): add missing plural in bulk template upload error handling (documenso#3357)

* docs: add externalId to send-for-signature workflow example (documenso#3325)

* fix: improve action auth flow for passwordless users (documenso#3358)

Selecting password auth failed with a generic "Unauthorized" for users
who signed up via OAuth or passkey, with no way to set one.

Detect the missing password and email the existing reset link from the
signing dialog and security settings. Require a 2FA code and rate limit
update-password.

* fix: use nuqs prevent infinite re-render loop (documenso#2868)

* fix: preserve base path in email asset URLs (documenso#3327)

* chore: upgrade deps (documenso#3367)

* feat: add document naming options when using templates (documenso#3086)

* refactor(server): simplify request context middleware (documenso#3341)

* chore(lib): remove unused timezone labels (documenso#3342)

* chore(prisma): remove unregistered middleware (documenso#3345)

* refactor(lib): reuse the http url validator (documenso#3346)

* fix(trpc): v2 field position updates silently dropped; rewrite fields API docs (documenso#3136)

* chore(ui): remove unused application skeletons (documenso#3340)

* chore(embedding): remove unregistered multi-sign mutation (documenso#3339)

* refactor(openpage): simplify the cors policy (documenso#3338)

* feat: allow signing reason override (documenso#2848)

* feat: replace template view tabs with a filter pill (documenso#3148)

* feat(ui): redesign recipient avatar stack hover popover (documenso#3072)

* feat: add inbox filters (documenso#3372)

* Respect hidden sender details in document invite emails (documenso#3061)

* fix: bulk download dialog overflow on long titles (documenso#3380)

* feat: add team document analytics dashboard (documenso#3355)

* fix: add date-fns to packages/ui (documenso#3388)

* fix: accept owner-password protected pdfs (documenso#3396)

Strip encryption from PDFs that open with an empty user password via
libpdf's ignorePermissions, still rejecting user-password PDFs.

Upgrade @libpdf/core to 0.5.1, which also keeps overlapping and layered
text intact during text extraction.

Resolves documenso#3303

* v2.19.0

* fix: embed signing completion and reload states (documenso#3409)

Send completed/rejected events when reopening an actioned v1 embed,
show the completed page after signing in v2, and tidy the completed
page.

* fix: use legacy pdfjs build for older devices (documenso#3410)

* feat: add recipient grouping (documenso#3319)

* fix(i18n): add missing "zu" in German invite/reminder strings (documenso#3331)

* fix: show validation errors in branding preferences form (documenso#3381)

* fix(ui): discard cancelled signature pad dialog drafts (documenso#3408)

\

* fix: prevent recipients who already signed from rejecting documents (documenso#3411)

* docs: add data-readonly and correct field color example (documenso#3413)

* fix(i18n): add support for plural in app-command-menu.tsx (documenso#3364)

* feat(admin): show team count in organisation stats (documenso#3405)

* fix: send notification on limits change (documenso#3414)

* fix: use the database url when the direct url is not set (documenso#3404)

* feat(web): add configurable legal, data protection, and imprint links (documenso#3114) (documenso#3131)

* fix: update legal links on recipient routes (documenso#3419)

* feat: allow admins to force remove non-completed recipients (documenso#3420)

<img width="1810" height="1408" alt="image"
src="https://github.com/user-attachments/assets/1375ebf6-9aa5-4f02-9b21-8913f71d6634"
/>

* fix(i18n): mark for translation admin stats table name (documenso#3421)

* feat: add sender disabled view to signing link (documenso#3423)

* fix: support cross-site authentication in embeds (documenso#3429)

Account, SSO and CSC authentication run in a popup and hand off
to the cross-site iframe via encrypted nonce-keyed rows.

Embed sessions are signing-only and rejected elsewhere unless
a route opts in.

Also adds origin-based CSRF for certain routes.

* chore: upgrade libpdf and critical deps (documenso#3430)

* v2.20.0

* fix: allow v1 multisign completion with empty optional fields (documenso#3417)

* fix: remove minio from development compose (documenso#3441)

* feat: disable accounts on report and show new account warning (documenso#3446)

* fix: use placeholder for stored sso client secret (documenso#3416)

* fix: reset field metadata when changing field type (documenso#3431)

Use the new field type's default metadata when no metadata is supplied,
while preserving existing metadata when the field type stays the same.

* fix(i18n): translate pending signing email subject (documenso#3438)

* chore: extract translations (documenso#3306)

* fix: keep previous table data during pagination (documenso#3073)

* chore: upgrade libpdf (documenso#3448)

* v2.21.0

* feat: persist signatures for authless embed signers (documenso#3465)

Embedders can pass `clientUserId` on `/embed/sign` to have the signer's
signature stored (hashed key, platform-gated, rate limited, capped per
recipient) and prefilled on their next embed.

* chore: update signing reminder docs (documenso#3469)

* chore: update AGENTS.md (documenso#3471)

* fix: don't remove passkeys on user disable (documenso#3470)

* v2.21.1

* chore: upgrade playwright and npm audit (documenso#3506)

* fix: prevent implicit form submission in editor field settings (documenso#3526)

* chore: docs/update enterprise edition (documenso#3472)

updated enterprise features section and added a comparison table.

both section has a hyperlink for easy sharing with leads

screenshot :
<img width="411" height="924" alt="image"
src="https://github.com/user-attachments/assets/aefbb84d-a688-41d3-966b-73bc2a86a2ed"
/>

---------

Co-authored-by: Timur Ercan <[email protected]>

* chore: update document visibility tooltip (documenso#3529)

updated tooltip and added description to the document visibility
section.
included a hyperlink in tooltip to
https://docs.documenso.com/docs/users/documents/advanced/document-visibility

default state:
<img width="515" height="337" alt="image"
src="https://github.com/user-attachments/assets/eb4218a9-86e5-42ed-a09e-d82d35804d0b"
/>

---------

Co-authored-by: Timur Ercan <[email protected]>

* fix: clarify sender details setting (documenso#3499)

* fix: disable signing when undo clears the signature pad (documenso#3518)

* fix: improve text field signing ux (documenso#3504)

* fix: ignore presses that start outside the signature pad (documenso#3522)

* feat: add handwriting font option for initials fields (documenso#3474)

* chore: skip the triage label for roadmap app issues (documenso#3573)

## Description

The Label Issues workflow adds `status: triage` to each new issue. This
includes the issues that the roadmap App (`documenso-roadmap-sync`)
opens for the public roadmap. Triage is only for issues that persons
open, thus the team removed the label by hand from each roadmap issue.

With this change, the workflow skips issues that the App opens or
reopens. Issues that persons open still get `status: triage`.

* chore: remove redundant waitForTimeout calls (documenso#3536)

* fix: open the 2fa code step when email is the only method (documenso#3528)

* fix: format prefilled dates with the document date format (documenso#3527)

* fix: use branding primary color for field loading spinner (documenso#3412)

* feat: add content fields (documenso#3395)

* fix: send test events only to the selected webhook (documenso#3542)

* chore: parallelise tests (documenso#3574)

* fix: correctly allow enterprise to bypass limits (documenso#3590)

* feat: add sort option for folders (documenso#3473)

* fix(i18n): add missing plural to analytics (documenso#3424)

* fix: open sign field dialogs on pointerclick so inputs autofocus (documenso#3583)

* fix: allow hiding the download button in embed signing (documenso#3589)

* fix: normalise user and recipient emails to lowercase (documenso#3591)

* fix: respect document timezone in read-only date fields (documenso#3582)

* fix: keep template field labels when prefill omits them (documenso#3585)

* chore: upgrade deps (documenso#3602)

* v2.22.0

* ci: supprime les workflows upstream inutilisables et lance la CI sur les PR vers staging

Retire les workflows hérités de documenso/documenso qui dépendent de
secrets ou runners absents du fork (Crowdin, DockerHub, GH_PAT, runner
warp) ou servent à la gestion communautaire des issues/PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(i18n): ajoute les textes de la pièce jointe et leur traduction française

Ajout ciblé dans les catalogues (pas d'extraction complète pour ne pas
diverger des .po upstream). Remplace la PR automatique #5.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Konrad <[email protected]>
Co-authored-by: David Nguyen <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Lucas Smith <[email protected]>
Co-authored-by: Catalin Pit <[email protected]>
Co-authored-by: Arun Kumar <[email protected]>
Co-authored-by: Ephraim Duncan <[email protected]>
Co-authored-by: roshboi <[email protected]>
Co-authored-by: Clayton Chew <[email protected]>
Co-authored-by: Rana Pratap Sarangi <[email protected]>
Co-authored-by: Romone6 <[email protected]>
Co-authored-by: Yash Singh <[email protected]>
Co-authored-by: Abdelrahman Abdelhamed <[email protected]>
Co-authored-by: Nandini Dhanrale <[email protected]>
Co-authored-by: Martin Glaser <[email protected]>
Co-authored-by: Grégory Chevalier <[email protected]>
Co-authored-by: Kendry Grullon <[email protected]>
Co-authored-by: Tanushree Ahir <[email protected]>
Co-authored-by: Christopher Ryan <[email protected]>
Co-authored-by: misinierijon4-debug <[email protected]>
Co-authored-by: Rodrigo Flávio <[email protected]>
Co-authored-by: water <[email protected]>
Co-authored-by: Arunendra Tripathi <[email protected]>
Co-authored-by: Nathan Delhaye <[email protected]>
Co-authored-by: Durgesh Shekhawat <[email protected]>
Co-authored-by: Zonaib Bokhari <[email protected]>
Co-authored-by: Raiyan Zaman <[email protected]>
Co-authored-by: Ayush Dubey <[email protected]>
Co-authored-by: Aykut Güney <[email protected]>
Co-authored-by: Timur Ercan <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
Preview – stg-docs — 7563ad3a Deployed Sep 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants