nextcloud / nextcloud/text

y-http provider to replace y-websocket and websocket polyfill

Open
#7,283 0 comments 1 reaction 1 assignee View on GitHub

@max-nextcloud is already working on this.

Since Jun 3, 2025.

enhancement
Dominant language
JavaScript
Stars
659
Forks
133
Avg merge
1d 20h
Merged PRs (30d)
110

Description

Is your feature request related to a problem? Please describe.
The yjs provider that syncs with the server is way to complex

Describe the solution you'd like
Have a y-http provider that takes care of the syncing and can handle being online / offline well.

y-http

  • open connection
  • expose connection
  • basic syncing
  • basic awareness messages
  • include url in connection
  • expect client to know params to open
  • use ydoc client id in open
  • handle awareness queries (without sending them)
  • delay test requests
  • ensure awareness messages are send at least every 10 seconds
  • return only newer messages in DummyServer
  • hand version to sync request
  • ensure old awareness states are cleared after 30 seconds
  • implement closing the connection
  • test reopening the connection

embedding in text js

  • implement client to instantiate y-http with
  • extract api calls from Sync service and use connection instead
  • extract document flags such as hasOwner from sync service and use them
  • implement events in y-http provider and handle them instead of sync service events

server side

  • allow flagging updates as full compressed history
  • at most send all versions since last compressed one
  • clean up older versions

later

  • process queries
  • send query message with every request
  • send compressed history
  • make the api stateless, removing the need for connection
  • reset remote doc when receiving compressed history
  • detect out of sync and reconnect (effectively receiving compressed history and all steps since then)
  • handle sync queries (without sending them)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.