Commit Graph
748 Commits
Author SHA1 Message Date
Classic298 414340682e perf: long chats no longer rewrite the whole conversation on every message (#34689)
Every sent message, finished reply, regenerate, edit and saved follow-up rewrote the whole stored conversation, so long chats got slower with each turn, most of all on PostgreSQL. Messages now live only in the message table the app already keeps, and a change writes only the messages it touches. Chats open, share, export and import as before. API responses no longer carry the flat message list older clients saved next to the conversation, and the answers to pinning, archiving, sharing or moving a chat no longer repeat its messages. Existing chats are converted once during the upgrade, in batches that continue where they stopped if the upgrade is interrupted.

| 130 MB chat, instant test model | SQLite before | SQLite after | PostgreSQL before | PostgreSQL after |
| --- | --- | --- | --- | --- |
| Message accepted | 2.4 s | 0.20 s | 10.9 s | 0.32 s |
| Reply done | 4.9 s | 0.9 s | 22.5 s | 1.4 s |
| Regenerate done | 4.6 s | 0.9 s | 19.6 s | 1.4 s |
| Saving an edit | 3.7 s | 1.8 s | 5.8 s | 1.7 s |
| Opening the chat | 2.3 s | 0.9 s | 1.6 s | 1.2 s |
| Written to the database per message | 533 MB | 2 KB | 533 MB | 2 KB |

Fixes #34688
2026-11-25 02:34:37 +04:00
Timothy Jaeryang Baek a17581475a refac 2026-11-25 02:15:42 +04:00
Timothy Jaeryang Baek e85500e773 refac 2026-11-25 01:48:46 +04:00
Timothy Jaeryang Baek c37725b7a3 refac 2026-11-25 01:07:47 +04:00
G30 c56ba4e759 fix: reject future birth dates in account settings (#34961) 2026-11-24 23:11:24 +04:00
Timothy Jaeryang Baek f10d244d05 refac 2026-11-24 22:26:11 +04:00
Timothy Jaeryang Baek 1fbb42be97 refac 2026-11-24 22:11:32 +04:00
Timothy Jaeryang Baek 0f71ee15a1 refac 2026-11-24 20:58:02 +04:00
Timothy Jaeryang Baek f4a12bbc7f refac 2026-11-23 22:16:20 +04:00
Classic298 4abf416f96 perf: sidebar folder list no longer reads every attached file in full (#34862)
For regular users, opening the app read every file attached to their folders in full, extracted text included, one by one, only to confirm they could still see it. Files the user uploaded themselves are now confirmed with one small lookup per folder. Files shared by others still get the full access check, so files the user lost access to are still removed from the folder as before. The list and what each folder shows are unchanged.

<table>
<tr><th>30 folders x 8 files of 300 KB, SQLite</th><th>Before</th><th>After</th></tr>
<tr><td>Folder list, typical load</td><td>335 ms</td><td>44-61 ms</td></tr>
<tr><td>Database queries per load</td><td>268</td><td>59</td></tr>
</table>

Fixes #34861
2026-11-23 18:40:20 +04:00
Timothy Jaeryang Baek 464e83e414 refac 2026-11-23 16:21:00 +04:00
Timothy Jaeryang Baek 5697a0939a refac 2026-11-23 16:10:09 +04:00
Timothy Jaeryang Baek c3747e8449 refac 2026-11-23 15:06:29 +04:00
Timothy Jaeryang Baek f62d8efc7c refac 2026-11-22 21:25:13 +04:00
Timothy Jaeryang Baek a5058fa562 refac 2026-11-22 20:43:18 +04:00
Timothy Jaeryang Baek df6be8c3a1 refac 2026-11-22 17:13:34 +04:00
Timothy Jaeryang Baek 67863f310c refac 2026-11-22 15:54:36 +04:00
Timothy Jaeryang Baek e72b31f01f refac 2026-11-22 02:51:42 +04:00
Timothy Jaeryang Baek f59a3aff85 refac 2026-11-22 02:10:33 +04:00
Timothy Jaeryang Baek 91344e88f7 refac 2026-11-21 23:58:03 +04:00
Timothy Jaeryang Baek 0ee690e272 refac 2026-11-21 22:27:07 +04:00
Timothy Jaeryang Baek d798367389 refac 2026-11-21 21:41:24 +04:00
Timothy Jaeryang Baek a8e6e5d777 refac 2026-11-21 19:18:19 +04:00
Timothy Jaeryang Baek 679087e7b3 refac 2026-11-21 18:55:53 +04:00
Timothy Jaeryang Baek 3097ac6666 refac 2026-11-21 18:41:47 +04:00
Timothy Jaeryang Baek 916c03829d chore: format 2026-11-17 22:37:26 +09:00
Timothy Jaeryang Baek 0181885a24 refac 2026-11-17 22:15:11 +09:00
Timothy Jaeryang Baek ae35197cee refac 2026-11-17 22:03:13 +09:00
Timothy Jaeryang Baek c68b8a632e refac 2026-11-17 17:02:34 +09:00
Timothy Jaeryang Baek f14dca0eec refac 2026-11-17 00:14:38 +09:00
Timothy Jaeryang Baek 6a0223a882 refac 2026-11-16 22:16:34 +09:00
Classic298 7611074e2a fix: adding the same new tag to several chats at once fails all but one (#34144)
When several requests from one account added the same new tag at the same moment, for example an API client tagging a batch of chats in parallel or two chat imports bringing the same tag, only one of them went through. The others failed with a server error, and a chat whose tag request failed stayed without the tag. A tag that another request created in the meantime now counts as already there, so every request succeeds and the tag is stored once.

Fixes #34143
2026-11-16 21:59:40 +09:00
Classic298 956ee485f9 fix: concurrent requests stall for 30 seconds and fail with database session sharing on (#34185)
With DATABASE_ENABLE_SESSION_SHARING on (off by default), the chat lists and the inbox held the request's database connection while they opened a second one for a small extra read. A burst of page loads then took every pooled connection, each request waited for a second connection, and they failed after the 30 second pool timeout with "QueuePool limit ... reached". Those extra reads now run on the request's own connection. In a burst of 80 page loads with a pool of 5, 11 failed on SQLite and 58 on PostgreSQL before this change, and none fail now.

Fixes #34184
2026-11-16 19:15:17 +09:00
Timothy Jaeryang Baek aa394849d8 refac 2026-11-16 17:52:06 +09:00
Timothy Jaeryang Baek a199370769 refac 2026-11-16 15:16:21 +09:00
Timothy Jaeryang Baek 31ef2064da refac 2026-11-15 16:56:45 +09:00
Timothy Jaeryang Baek d7b3d08b4f refac 2026-11-14 14:16:19 +09:00
G30 0cce86d535 fix: a tag's chosen color shows in a folder's filter menu, group headers and board columns (#34390) 2026-11-14 06:41:02 +09:00
Timothy Jaeryang Baek 6378f94a65 refac 2026-11-14 00:45:43 +09:00
Timothy Jaeryang Baek 121bc0ec50 refac 2026-11-14 00:14:28 +09:00
Timothy Jaeryang Baek f1d735d807 refac 2026-11-13 23:50:28 +09:00
Timothy Jaeryang Baek 06491f0132 refac 2026-11-13 22:40:53 +09:00
G30 44d2dd3d52 feat: deleting an account removes the access grants that name it (#34223) 2026-11-13 19:03:00 +09:00
Classic298 3d36b436c6 fix: chat reopens on an older turn after an out-of-date window saves an edit (#34160)
A window that had missed a turn, for example a laptop that just woke up and has not reconnected yet, saved its own, older idea of where the chat was when it saved an edited message. The chat then reopened on that older turn, and the next message started a new branch there, so the newest reply moved behind the branch switch and the model no longer saw it. A save now keeps the chat on the newest turn of the branch it is on, the same turn the chat already shows once it has caught up.

Fixes #34126
2026-11-12 21:42:21 +09:00
Timothy Jaeryang Baek 28c5fba889 refac 2026-11-11 13:49:51 +09:00
Timothy Jaeryang Baek b01fe7fae2 refac 2026-11-10 17:22:51 +09:00
Timothy Jaeryang Baek da850248d1 refac 2026-11-10 15:56:52 +09:00
Timothy Jaeryang Baek 98f94057bb refac 2026-11-10 13:05:45 +09:00
Timothy Jaeryang Baek 537e223ede refac 2026-11-09 15:35:53 +09:00
Timothy Jaeryang Baek 6d3123b5b4 refac 2026-11-08 21:15:39 +09:00