Commit graph

44 commits

Author SHA1 Message Date
Classic298
89716ea880
perf: stop scanning every socket.io payload for binary data (#28180)
* perf: stop scanning every socket.io payload for binary data

Every socket.io event the backend sends was first walked recursively to check whether any value was a bytes object needing binary attachment framing. Open WebUI never emits binary, so the walk always came back empty and the work was thrown away. It has no early exit and allocates at every level, so it scaled with the full size of the message, and the messages are the big ones: chat streaming re-emits the whole assistant message on every update, note collaboration sends document state as a JSON array with one entry per byte. With the Redis manager it ran once per instance per emit on top of that, since every instance builds its own copy of the packet.

The server now installs a Packet subclass with binary events off, through python-socketio's own serializer hook, the same mechanism its msgpack serializer uses. Inbound binary attachments are decoded to int lists rather than refused, so the one frontend path that sends a raw Uint8Array keeps working and handlers can still echo client data straight back out. One scan remains in multi-instance setups: python-socketio's Redis manager calls it on the base Packet class directly, where the serializer hook cannot reach.

Measured per encode:

| payload | before | after |
|---|---|---|
| chat completion re-emit (7.5 KB JSON) | 30 us | 13 us |
| collaborative document state (292 KB JSON) | 9.0 ms | 1.7 ms |

With ENABLE_ORJSON=true, where the scan is nearly the whole encode cost: 20 us to 2.3 us, and 7.8 ms to 0.14 ms.

Closes #28164

* fix: match the other Yjs emits and send the full state as an array

Collaboration.ts sent the initial full-document state as a raw Uint8Array while the other two Yjs emit sites convert with Array.from first. socket.io framed that one as a binary attachment, so with the JSON-only packet class the server turns it into a list of ints and re-broadcasts it as JSON: a 10240-byte state update becomes 36561 JSON characters. Converting at the emit site keeps the wire form uniform across all three sites.

Also trims the JSONOnlyPacket docstring, which claimed attachments already arrive as int lists when the override is what converts them, and annotates the new reconstruct_binary parameters.
2026-08-31 01:22:06 -04:00
Timothy Jaeryang Baek
5078d987f8 refac
Some checks are pending
Python CI / Ruff Format (3.11) (push) Waiting to run
Python CI / Ruff Format (3.12) (push) Waiting to run
Create and publish Docker images with specific build args / copy-to-dockerhub (-slim, slim) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-ollama, ollama) (push) Blocked by required conditions
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true USE_CUDA_VER=cu126 free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_OLLAMA=true free_disk:false name:ollama suffix:-ollama]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/amd64 runner:ubuntu-latest], map[build_args:USE_SLIM=true free_disk:false name:slim suffix:-slim]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args: free_disk:false name:main suffix:]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true USE_CUDA_VER=cu126 free_disk:true name:cuda126 suffix:-cuda126]) (push) Waiting to run
Create and publish Docker images with specific build args / build (map[arch:linux/arm64 runner:ubuntu-24.04-arm], map[build_args:USE_CUDA=true free_disk:true name:cuda suffix:-cuda]) (push) Waiting to run
Create and publish Docker images with specific build args / merge (map[name:cuda suffix:-cuda]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:cuda126 suffix:-cuda126]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:main suffix:]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:ollama suffix:-ollama]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / merge (map[name:slim suffix:-slim]) (push) Blocked by required conditions
Create and publish Docker images with specific build args / notify-helm-charts (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (, main) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda, cuda) (push) Blocked by required conditions
Create and publish Docker images with specific build args / copy-to-dockerhub (-cuda126, cuda126) (push) Blocked by required conditions
Frontend Build / Format & Build (push) Waiting to run
Frontend Build / Unit Tests (push) Waiting to run
2026-08-24 21:15:54 -04:00
G30
302ffc8b7e
fix: skip the autocompletion debounce when the document shrank past the captured position (#28824) 2026-08-22 08:12:40 -04:00
Timothy Jaeryang Baek
29eeda9f9a refac 2026-08-05 07:12:28 -05:00
Timothy Jaeryang Baek
2b8ef9340e refac 2026-07-15 23:51:37 -04:00
G30
eba1540a95
feat(ui): add emoji picker to rich text formatting toolbar (#24704) 2026-05-15 09:32:56 +09:00
Classic298
cfd2888545
fix:image url validation and signout post (#24420)
* refac(routers): reject external URLs in profile/model image handlers

* refac(ui): centralize image URL validation in safeImageUrl helper

* refac(auths): make signout POST-only

* refac: gate external profile image redirect behind ENABLE_PROFILE_IMAGE_URL_FORWARDING

Restore the 302 redirect for external http(s) profile image URLs in
the user and model profile-image endpoints, but gate it behind a new
ENABLE_PROFILE_IMAGE_URL_FORWARDING env flag (default: True).

Existing deployments that rely on external profile image forwarding
continue to work unchanged.  Operators who want to suppress the
redirect (to prevent client-side IP/UA/Referer leaks) can set the
flag to False.
2026-05-09 07:33:31 +09:00
Timothy Jaeryang Baek
6c2b2f2c3e refac 2026-03-29 19:01:53 -05:00
G30
6089a55da6
fix(ui): chat input triggers correctly re-trigger on backspace (#22899) 2026-03-20 15:48:25 -05:00
Timothy Jaeryang Baek
700349064d chore: format 2026-01-08 01:55:56 +04:00
Timothy Jaeryang Baek
e27fb3e291 refac 2026-01-05 17:44:44 +04:00
Timothy Jaeryang Baek
b0d8372d31 refac 2025-12-20 17:41:57 +04:00
Timothy Jaeryang Baek
d1c9555a0b refac 2025-10-28 01:46:36 -07:00
Timothy Jaeryang Baek
b72443004d refac/chore: svelte 5 migration 2025-10-27 15:06:53 -07:00
Timothy Jaeryang Baek
aeb5288a3c refac 2025-09-22 23:28:19 -04:00
Timothy Jaeryang Baek
e4e97e727e enh: note drag handle 2025-09-22 20:02:37 -04:00
Shirasawa
7f6b260c35 feat: refactor editor's collaboration to reduce package size and minimize errors 2025-09-19 17:28:16 +08:00
Timothy Jaeryang Baek
1d0881e283 refac 2025-09-17 01:28:04 -05:00
Timothy Jaeryang Baek
22e11760a1 refac 2025-09-14 18:08:31 -04:00
Timothy Jaeryang Baek
56a8973fa0 refac 2025-09-13 00:30:00 +04:00
Timothy Jaeryang Baek
d6094c2881 refac 2025-09-13 00:24:42 +04:00
Timothy Jaeryang Baek
06c1426e14 refac: channel input 2025-09-12 21:43:05 +04:00
Timothy Jaeryang Baek
6b69c4da0f refac/enh: commands ui 2025-09-12 20:31:57 +04:00
Timothy Jaeryang Baek
58a6f5df98 fix: sink list icon missing 2025-08-10 16:07:52 +04:00
silentoplayz
84e568f902 remove: ArrowRightTag.svelte and used a transform 2025-07-27 20:43:17 -04:00
Timothy Jaeryang Baek
a01e5126a3 refac 2025-07-19 21:34:38 +04:00
Timothy Jaeryang Baek
c1c589d609 refac/enh: rich text input 2025-07-18 15:58:06 +04:00
Timothy Jaeryang Baek
d4ece7384c enh/refac: note image upload 2025-07-17 17:36:06 +04:00
Timothy Jaeryang Baek
fce27202d9 refac 2025-07-17 02:37:18 +04:00
Timothy Jaeryang Baek
8b8ce2592d refac: styling 2025-07-14 19:34:40 +04:00
Timothy Jaeryang Baek
6d31fc7875 refac: styling 2025-07-09 13:50:45 +04:00
Timothy Jaeryang Baek
c2ac797650 feat: formatting buttons 2025-07-09 03:11:51 +04:00
Tryanks
612ca54afa enh: non-english (chinese) autocompletion handling 2025-01-17 01:50:23 +08:00
Vojtěch Šiler
70a6a0d9e8 Fix errors for RangeErrors, Fix for accessing undefined objects in Chat.svelte 2025-01-07 08:54:42 +01:00
Timothy Jaeryang Baek
460992613f refac: styling 2024-12-01 17:15:16 -08:00
Timothy Jaeryang Baek
746fe9ea16 refac: autocomplete 2024-11-30 23:46:29 -08:00
Timothy Jaeryang Baek
2fac9b45cd chore: format 2024-11-30 23:36:30 -08:00
Timothy Jaeryang Baek
370f97b44e refac 2024-11-30 23:33:19 -08:00
Timothy Jaeryang Baek
c192475528 refac: autocompletion 2024-11-30 18:02:21 -08:00
Timothy Jaeryang Baek
5b879a2121 refac: autocompletion behaviour 2024-11-30 13:10:47 -08:00
Timothy Jaeryang Baek
3792051604 enh: swipe to accept completion 2024-11-30 01:06:56 -08:00
Timothy Jaeryang Baek
1f53e0922e enh: autocompletion 2024-11-30 00:29:27 -08:00
Timothy Jaeryang Baek
fa5e1f7452 refac 2024-11-28 23:24:16 -08:00
Timothy Jaeryang Baek
95000c7b15 feat: ai autocompletion 2024-11-28 23:22:53 -08:00