Skip to content

Add support for Y_SWEET_MAX_BODY_SIZE#405

Merged
paulgb merged 1 commit into
jamsocket:mainfrom
Athena-Intel:feat/max_body_size_pr
Aug 27, 2025
Merged

Add support for Y_SWEET_MAX_BODY_SIZE#405
paulgb merged 1 commit into
jamsocket:mainfrom
Athena-Intel:feat/max_body_size_pr

Conversation

@rmdort

@rmdort rmdort commented Aug 27, 2025

Copy link
Copy Markdown
Contributor

This PR adds support for Y_SWEET_MAX_BODY_SIZE environment variable to override the default axum websocket body size of 2MB

@vercel

vercel Bot commented Aug 27, 2025

Copy link
Copy Markdown

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

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
y-sweet-debugger Ignored Ignored Preview Aug 27, 2025 8:04am
y-sweet-gendocs Ignored Ignored Preview Aug 27, 2025 8:04am

@vercel

vercel Bot commented Aug 27, 2025

Copy link
Copy Markdown

@rmdort is attempting to deploy a commit to the drifting-corp Team on Vercel.

A member of the Team first needs to authorize it.

@paulgb

paulgb commented Aug 27, 2025

Copy link
Copy Markdown
Member

Thanks @rmdort!

@paulgb paulgb merged commit 6f5509e into jamsocket:main Aug 27, 2025
8 of 9 checks passed
abyssparanoia added a commit to arcterus-jp/y-sweet that referenced this pull request Feb 4, 2026
* derive Deserialize for ClientToken (jamsocket#403)

makes it easier to consume the ClientToken for other rust libraries

* Add support for Y_SWEET_MAX_BODY_SIZE (jamsocket#405)

This PR adds support for `Y_SWEET_MAX_BODY_SIZE` environment variable to
override the default axum websocket body size of 2MB

* better websocket URL generation (jamsocket#406)

* v0.9.0 (jamsocket#408)

* add websocket pings/pongs to help close zombie connections (jamsocket#410)

* fix some websocket server issues (jamsocket#411)

One of these fixes an issue I introduced in my last PR. The other is
pre-existing.

* v0.9.1 (jamsocket#412)

* Allow pycrdt up to and including 0.12.x (jamsocket#414)

Fixes jamsocket#400

Tested locally:

```
uv run pytest
......                                                                                                                                 [100%]
6 passed in 20.34s
```

* only persist documents to S3 when dirty (jamsocket#416)

Fix an issue where y-sweet was persisting documents to S3 every ~10
seconds even when no changes had occurred.

From what I understand, the persistence worker wakes up both on the
dirty signal and also on a `checkpoint_freq` interval and was always
calling persist, regardless of the dirtiness, which would write it to S3
regardless of whether any changes had been made.

The fix adds a check to only persist when the document is actually
dirty.

I'm still a little bit unclear behind the reasoning for the logic of
signaling the worker both on a dirty callback and on a timer.

So I wonder if we instead just start the worker once, wake every 10
seconds, check if dirty, persist if needed.

* use SeqCst ordering for sync_kv dirty flag (jamsocket#417)

Now that [we're not persisting unless the document is marked
dirty](jamsocket#416), let's use an
atomic ordering with stronger guarantees for the KV store's `dirty`
flag.

* Allow to disable GC within documents using env variable/CLI (jamsocket#422)

### References

- closes jamsocket#421 

### Description

Adds an option to disable GC within documents (distinct from GC of
documents in multi-document mode) via:
- CLI by passing `--skip-gc` to either of `y-sweet serve` or `y-sweet
serve-doc`
- `Y_SWEET_SKIP_GC` environment variable

I was not sure if I should also add the environment variable to
`y-sweet-worker` for feature parity but given that it is deprecated I
went for a smaller changeset and only added it in the server.

I wonder if the configuration for toggling GC of documents themselves
(the `doc_gc` option which is not exposed by clap) would be advisable,
but I think it is already possible to configure
`checkpoint_freq_seconds` instead which can be set to a very high value
that is probably better than turning it off altogether.

* feat: divide before main stream

* fix: lint

---------

Co-authored-by: Theodor Tonum <theodor@tonum.no>
Co-authored-by: Vinay M <rmdort@gmail.com>
Co-authored-by: Taylor Baldwin <taylorbaldwin@gmail.com>
Co-authored-by: Michał Krassowski <5832902+krassowski@users.noreply.github.com>
Co-authored-by: Aleksey Smolenchuk <lxe@lxe.co>
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