Skip to content

馃浄 perf: Reduce Browser Work When Sending Documents - #16646

Merged
danny-avila merged 1 commit into
devfrom
lia/composer-send-lag
Oct 2, 2026
Merged

danny-avila merged 1 commit into
devfrom
lia/composer-send-lag

Conversation

@lia-by-librechat

@lia-by-librechat lia-by-librechat Bot commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A document send performs repeated synchronous localStorage work, and the composer redraws unchanged attachment previews and workspace state. These costs sit in the browser, not the model response path.

Batch all submitted file aliases into one ledger write before consuming attachments. Keep the tray's pending-action callback stable, and notify workspace consumers only when data, loading, or error state changes. Polling, recovery, upload delivery metadata, and cross-tab deletion protection remain intact. Model reasoning effort is unchanged.

Related to #16572.

How it works

send
  collect attachment payload and identities in one pass
  publish submitted identities once
  clear consumed attachments

workspace refresh
  unchanged data: no consumer render
  changed data or failure: update readiness and send gate

Type of change

  • Bug fix
  • Performance improvement

Testing

  • Regression tests cover one write per document send, all file aliases, bounded storage and storage failures, stable document previews while typing, and unchanged workspace refreshes.
  • Existing tests cover workspace failures/recovery, draft protection, and attachment/paste interactions.
  • Focused Jest: 9 suites, 271 tests passed. Client tsc --noEmit, scoped static checks, and git diff --check passed.
  • Negative controls: all 4 new send/render assertions fail against base e689243d9. Document ledger writes fall from 3 to 1; override writes from 2 to 1; preview renders during typing fall from 19 to at most 1.
  • Production frontend and all shared-package builds passed. Local Lighthouse was attempted but cannot launch Chromium because libatk-1.0.so.0 is unavailable. The CI Lighthouse lane covers the standard harness.
  • Independent review completed at 9834b0a408b62b987d6ee054da0c6e645bdf4738: no findings. Browser send timing and real multi-tab runtime behavior were not profiled.

Screenshots / recordings

No visual or layout changes. No browser recording captured.

Risk / compatibility

No API, configuration, or stored-data format changes. Workspace polling retains its existing interval and error recovery.

Checklist

  • I reviewed my own changes
  • Relevant tests have been added or updated
  • Existing relevant tests pass
  • The change does not introduce new warnings or errors
  • Required dependency changes: N/A
  • Required documentation PR: N/A

Title verification: 馃浄 has 0 prior uses in 5,877 indexed commits through 2026-10-01 21:39:51 UTC. The sentinel passed. The sled represents removing friction from sending.

@lia-by-librechat

Copy link
Copy Markdown
Contributor Author

Head: 9834b0a408b62b987d6ee054da0c6e645bdf4738. Batches submitted document aliases, stabilizes preview actions, and avoids unchanged workspace-refresh renders. Local checks: 9 focused Jest suites, 271 tests; client tsc --noEmit; scoped static checks. Independent review is running. Browser send timing has not been profiled.

@danny-avila
danny-avila merged commit 4d27fac into dev Oct 2, 2026
30 checks passed
@danny-avila
danny-avila deleted the lia/composer-send-lag branch October 2, 2026 00:43
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.

2 participants