LibreChat/packages/data-provider
Marco Beretta 8e6e6f062d
🪧 fix: Emit the Configured-Footer Answer With the HTML Shell (#15886)
* 🪧 fix: Emit the Configured-Footer Answer With the HTML Shell

The chat surface lays out against whether the deployment configured a footer
(customFooter, privacy policy, terms of service). The client answered that from
localStorage — whatever the last resolved `/api/config` recorded — so the answer
was a guess on a first-ever visit and could be stale for a deployment whose
configuration changed.

The backend already knows when it serves client/dist/index.html, so it says so
there: `injectConfiguredFooterBootstrap` writes `hasConfiguredFooter` into
`window.__LIBRECHAT_CONFIG__` ahead of the app's own scripts, once at boot from
the base app config, and the client reads it on its first render instead of
remembering the last answer. The `configured-footer` storage atom is gone.

Client and server share one predicate (`hasConfiguredFooter` in
librechat-data-provider) so the two cannot disagree, and the shell injection is
generalized (`injectBootstrapConfig`), with the query-devtools flag now going
through it.

* 🧷 fix: Keep Bootstrap Values Literal and State the Shell's Contract

`injectBootstrapConfig` passed its script as a replacement string, so a `$&`,
`$1` or `$'` inside an injected value was expanded by `String.replace` instead
of reaching the client. Both insertion points take a replacement function now,
and the spec reads its values back off the global through an explicit result
type rather than an unchecked dictionary.

The shell answers from the deployment's own configuration, which a per-tenant,
role or user override of `interface.privacyPolicy` or `termsOfService` can
disagree with — `/api/config` resolves the caller's and the client prefers it.
That contract was overstated in three comments ("a deployment-lifetime fact",
"the same one the config will give"); they now say what the answer is and what
resolves the rest. Two scenarios cover the disagreement end to end: a document
served without the answer, and a policy link only this caller's config carries.
2026-09-13 21:53:54 -04:00
..
react-query 📦 chore: bump axios to v1.20.0, @librechat/agents to v3.7.4 (#15285) 2026-08-27 08:56:29 -04:00
specs 🏷️ fix: Keep a Configured Sender Label From Revealing the Model on Hover (#15489) 2026-09-13 11:57:12 -04:00
src 🪧 fix: Emit the Configured-Footer Answer With the HTML Shell (#15886) 2026-09-13 21:53:54 -04:00
.gitignore
babel.config.js
check_updates.sh
jest.config.js
package.json 🚀 v0.8.8-rc3 (#15859) 2026-09-13 02:17:48 -04:00
server-rollup.config.js
tsconfig.build.json
tsconfig.json
tsconfig.spec.json
tsdown.config.mjs 🌀 ci: Deterministic Circular Dependency Checks (#14579) 2026-08-01 14:43:26 -04:00