Skip to content

✨(backend) add a setting to send json on the http fallback - #2829

Merged
AntoLC merged 2 commits into
mainfrom
collab/fallbak-json
Oct 15, 2026
Merged

AntoLC merged 2 commits into
mainfrom
collab/fallbak-json

Conversation

@AntoLC

@AntoLC AntoLC commented Oct 12, 2026

Copy link
Copy Markdown
Member

Purpose

Some firewalls refuse the application/x-lib0any content type the collaboration server answers with on the http fallback (and the application/octet-stream the fallback sends), so the browsers behind them cannot sync when their websocket is blocked too.

Proposal

  • COLLABORATION_HTTP_FALLBACK_JSON_ENABLED (default False): the fallback sends and receives application/json, with the binary parts in base64, which the collaboration server already supports
  • the translation lives in the fetch given to the http provider, so the only content type on the wire is application/json; the document is about a third larger on each transfer

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Preview will be available at https://2829-docs.ppr-docs.beta.numerique.gouv.fr/

You can use the existing account with these credentials:

  • username: docs
  • password: docs

You can also create a new account if you want to.

Once this Pull Request is merged, the preview will be destroyed.

Comment thread src/frontend/apps/impress/package.json Outdated
@AntoLC
AntoLC requested a review from dmonad October 12, 2026 18:56
@github-actions

github-actions Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Size Change: +2.5 kB (+0.06%)

Total Size: 4.06 MB

📦 View Changed
Filename Size Change
apps/impress/out/_next/static/53968095/_buildManifest.js 739 B +739 B (new file) 🆕
apps/impress/out/_next/static/c0e885e1/_buildManifest.js 0 B -740 B (removed) 🏆
apps/impress/out/_next/static/chunks/1519.js 60.6 kB +503 B (+0.84%)
apps/impress/out/_next/static/chunks/6076.js 0 B -84.3 kB (removed) 🏆
apps/impress/out/_next/static/chunks/9042.js 86.3 kB +86.3 kB (new file) 🆕

compressed-size-action

@AntoLC
AntoLC force-pushed the collab/fallbak-json branch 6 times, most recently from 06e1c2c to 1a4e431 Compare October 13, 2026 12:39
Comment thread documentation/env.md
| CACHES_SESSION_SOCKET_TIMEOUT | Timeout for read and write operations after the connection is established for the session cache (In seconds) | 1 |
| COLLABORATION_HTTP_FALLBACK_AWARENESS_ENABLED | Whether an editor on the http fallback (see `COLLABORATION_HTTP_FALLBACK_SYNC_INTERVAL`) also publishes and receives presence (remote cursors). Set it to `False` to drop the periodic presence update and the 15000 cap on the polling interval: such an editor sends a request only when it has changes. Readers never carry presence. | True |
| COLLABORATION_HTTP_FALLBACK_SYNC_INTERVAL | How often, in milliseconds, a browser whose websocket cannot open (a proxy refusing the upgrade, for example) polls the collaboration server over http instead. Each poll is authorized against the backend, so raising it lowers the load those browsers put on both. It must be at least 5000, the backend refuses to start below. An editor also publishes its presence on this transport, which caps its own interval at 15000. | 10000 |
| COLLABORATION_HTTP_FALLBACK_JSON_ENABLED | Whether a browser whose websocket cannot open (a proxy refusing the upgrade, for example) talks json instead of the binary `application/x-lib0any` format to the collaboration server over http, for the networks whose firewall refuses that content type. The binary parts travel in base64, about a third larger. | False |

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

should be before COLLABORATION_HTTP_FALLBACK_SYNC_INTERVAL to keep the correct order

Some firewalls refuse the application/x-lib0any content type the http
fallback gets from the collaboration server, and the octet-stream it
sends, so the browsers behind them cannot sync when their websocket is
blocked too.

Add COLLABORATION_HTTP_FALLBACK_JSON_ENABLED (default False), served by
the config endpoint. On, the fallback sends and receives application/json
with the binary parts in base64, which the collaboration server already
supports. The cost is a document about a third larger on each transfer.
The dev-backend chart 0.0.10 started the media storage with a hardcoded
`minio server` shell command and pulled quay.io/minio/mc to create the
bucket. Since the switch to pgsty/silo, the first one failed with
"minio: command not found" and the second one with a 401 from quay.io, so
the feature deployments (ArgoCD) did not come up.

Chart 0.0.15 defaults to pgsty/silo and pgsty/mc, and starts the container
with `args` instead of a shell command, so the name of the executable no
longer matters.
@AntoLC
AntoLC force-pushed the collab/fallbak-json branch from 1a4e431 to b5c1565 Compare October 15, 2026 09:23
@AntoLC
AntoLC merged commit b5c1565 into main Oct 15, 2026
50 checks passed
@AntoLC
AntoLC deleted the collab/fallbak-json branch October 15, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants