[PR #5557] [CLOSED] 🛠 Upgrade crdt package #5996

Closed
opened 2026-02-28 21:22:15 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5557
Author: @MikesGlitch
Created: 8/14/2025
Status: Closed

Base: masterHead: crdt-package-es6


📝 Commits (10+)

📊 Changes

23 files changed (+500 additions, -1778 deletions)

View changed files

📝 bin/package-electron (+1 -0)
📝 package.json (+3 -2)
📝 packages/crdt/README.md (+1 -17)
packages/crdt/bin/generate-proto (+0 -26)
packages/crdt/buf.gen.yaml (+8 -0)
📝 packages/crdt/package.json (+4 -5)
📝 packages/crdt/src/index.ts (+17 -10)
📝 packages/crdt/src/proto/sync.proto (+1 -1)
packages/crdt/src/proto/sync_pb.js (+0 -1294)
📝 packages/crdt/src/proto/sync_pb.ts (+159 -217)
📝 packages/loot-core/src/server/polyfills.ts (+0 -26)
📝 packages/loot-core/src/server/sync/encoder.ts (+52 -43)
📝 packages/loot-core/src/server/sync/make-test-message.ts (+7 -7)
📝 packages/loot-core/src/server/tests/mockSyncServer.ts (+28 -22)
📝 packages/sync-server/docker/alpine.Dockerfile (+6 -2)
📝 packages/sync-server/docker/ubuntu.Dockerfile (+6 -2)
📝 packages/sync-server/package.json (+1 -1)
📝 packages/sync-server/src/app-sync.test.ts (+9 -9)
📝 packages/sync-server/src/app-sync.ts (+19 -12)
📝 packages/sync-server/src/sync-simple.js (+12 -11)

...and 3 more files

📄 Description

I'm letting this go stale

I think it's worth doing at some point but probably when we've got a server bundler so we can benefit from not having the crdt npm package.


Note

  • Worth testing this one with your server.
  • This could be a controversial one, happy to abandon this PR if we think it's not worth it given we rarely change crdt.

When upgrading loot-core to vite I ran into an issue where crdt's generated proto file was not compatible out of the box. To account for that I had to make a polyfill. This PR regenerates the proto file in a more compatible format.

Benefits:

  • We can remove the polyfills that were needed to satisfy vite
  • The proto file is now much easier to generate - you don't need to install anything extra, just run yarn proto:generate
  • I have changed the sync-server to reference the crdt package via workspace instead of npm package. It means locally we use the workspace for the latest code, but we do still need to publish @actual-app/crdt because it's still a dependency of server.

Tested:

  • Test old server with new client (updated crdt)
    • messages still sync - compatible
  • Test new server (updated crdt) with old client
    • messages still sync - compatible
  • Test the sync-server npm package - the build will need updated to ensure crdt is built first
  • Run it for a few days
  • Test the dockerfile (built locally)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/actualbudget/actual/pull/5557 **Author:** [@MikesGlitch](https://github.com/MikesGlitch) **Created:** 8/14/2025 **Status:** ❌ Closed **Base:** `master` ← **Head:** `crdt-package-es6` --- ### 📝 Commits (10+) - [`1937b26`](https://github.com/actualbudget/actual/commit/1937b26175825661f129fb1ca60e580e1f07de21) updating crdt package to be easier to generate and compatible with es6 - [`6bc78c8`](https://github.com/actualbudget/actual/commit/6bc78c8cd3bb8ff0275dc377378dde635797521a) fix test - [`3d277ae`](https://github.com/actualbudget/actual/commit/3d277ae11ad8ac3010ba68ab8768965f222c5943) fix test - [`6da418a`](https://github.com/actualbudget/actual/commit/6da418a66b84590fc1aed34a5c0c666b9c422815) building crdt for electron - [`5e39ebf`](https://github.com/actualbudget/actual/commit/5e39ebf57e1d2e05b67e9c20736c26f25162825a) updating docker files and protofobuf needs undefined instead of nulls - [`9dfbd36`](https://github.com/actualbudget/actual/commit/9dfbd36c1b34f188f9d20c526b7b0a89ca0fbbff) Merge branch 'master' of https://github.com/MikesGlitch/actual into crdt-package-es6 - [`3c0925e`](https://github.com/actualbudget/actual/commit/3c0925e1ce4e2475c1aee01db5cbb5eb50d250ac) the other dockerfile - [`30f1c59`](https://github.com/actualbudget/actual/commit/30f1c59c1b2103a59f51fe88d97b1a30aeeb45e5) Merge branch 'master' of https://github.com/MikesGlitch/actual into crdt-package-es6 - [`b70c6dd`](https://github.com/actualbudget/actual/commit/b70c6ddd512158445b3ca5917155402cdc49f2f9) release notes - [`7274d6c`](https://github.com/actualbudget/actual/commit/7274d6ccf27d464cae744418ea4d0927ead9d38a) release ntoes ### 📊 Changes **23 files changed** (+500 additions, -1778 deletions) <details> <summary>View changed files</summary> 📝 `bin/package-electron` (+1 -0) 📝 `package.json` (+3 -2) 📝 `packages/crdt/README.md` (+1 -17) ➖ `packages/crdt/bin/generate-proto` (+0 -26) ➕ `packages/crdt/buf.gen.yaml` (+8 -0) 📝 `packages/crdt/package.json` (+4 -5) 📝 `packages/crdt/src/index.ts` (+17 -10) 📝 `packages/crdt/src/proto/sync.proto` (+1 -1) ➖ `packages/crdt/src/proto/sync_pb.js` (+0 -1294) 📝 `packages/crdt/src/proto/sync_pb.ts` (+159 -217) 📝 `packages/loot-core/src/server/polyfills.ts` (+0 -26) 📝 `packages/loot-core/src/server/sync/encoder.ts` (+52 -43) 📝 `packages/loot-core/src/server/sync/make-test-message.ts` (+7 -7) 📝 `packages/loot-core/src/server/tests/mockSyncServer.ts` (+28 -22) 📝 `packages/sync-server/docker/alpine.Dockerfile` (+6 -2) 📝 `packages/sync-server/docker/ubuntu.Dockerfile` (+6 -2) 📝 `packages/sync-server/package.json` (+1 -1) 📝 `packages/sync-server/src/app-sync.test.ts` (+9 -9) 📝 `packages/sync-server/src/app-sync.ts` (+19 -12) 📝 `packages/sync-server/src/sync-simple.js` (+12 -11) _...and 3 more files_ </details> ### 📄 Description <!-- Thank you for submitting a pull request! Make sure to follow the instructions to write release notes for your PR — it should only take a minute or two: https://github.com/actualbudget/docs#writing-good-release-notes. Try running yarn generate:release-notes *before* pushing your PR for an interactive experience. --> # I'm letting this go stale I think it's worth doing at some point but probably when we've got a server bundler so we can benefit from not having the crdt npm package. --- >[!NOTE] > - Worth testing this one with your server. > - This could be a controversial one, happy to abandon this PR if we think it's not worth it given we rarely change crdt. When upgrading loot-core to vite I ran into an issue where crdt's generated proto file was not compatible out of the box. To account for that I had to make a polyfill. This PR regenerates the proto file in a more compatible format. Benefits: - We can remove the polyfills that were needed to satisfy vite - The proto file is now much easier to generate - you don't need to install anything extra, just run `yarn proto:generate` - I have changed the sync-server to reference the crdt package via workspace instead of npm package. It means locally we use the workspace for the latest code, but we do still need to publish @actual-app/crdt because it's still a dependency of server. Tested: - [x] Test old server with new client (updated crdt) - messages still sync - compatible - [x] Test new server (updated crdt) with old client - messages still sync - compatible - [x] Test the sync-server npm package - the build will need updated to ensure crdt is built first - [x] Run it for a few days - [x] Test the dockerfile (built locally) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-02-28 21:22:15 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#5996