[Bug]: Syncing is broken between multiple tabs in the same browser instance #553

Open
opened 2026-02-28 19:08:49 -06:00 by GiteaMirror · 10 comments
Owner

Originally created by @Cldfire on GitHub (Aug 8, 2023).

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

On the v23.8.1 release, creating a new budget file immediately yields constant and unfixable sync errors if more than a single client is connected:

https://github.com/actualbudget/actual/assets/13814214/e845576b-56ab-4251-902f-5560f11f6a55

[Log] 15:57:40.219Merkle hash in db: – undefined (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 15:57:40.219Error: SyncError: out-of-sync (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
Wo — errors.ts:31
(anonymous function) — index.ts:751
[Log] 15:57:40.219[Exception] (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
Error: SyncError: out-of-sync
Wo — errors.ts:31
(anonymous function) — index.ts:751

What error did you receive?

No response

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Safari

Operating System

Mac OSX

Originally created by @Cldfire on GitHub (Aug 8, 2023). ### Verified issue does not already exist? - [X] I have searched and found no existing issue ### What happened? On the v23.8.1 release, creating a new budget file immediately yields constant and unfixable sync errors if more than a single client is connected: https://github.com/actualbudget/actual/assets/13814214/e845576b-56ab-4251-902f-5560f11f6a55 ``` [Log] 15:57:40.219Merkle hash in db: – undefined (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 15:57:40.219Error: SyncError: out-of-sync (kcab.worker.61dd77d50c3de3a5c965.js, line 2) Wo — errors.ts:31 (anonymous function) — index.ts:751 [Log] 15:57:40.219[Exception] (kcab.worker.61dd77d50c3de3a5c965.js, line 2) Error: SyncError: out-of-sync Wo — errors.ts:31 (anonymous function) — index.ts:751 ``` ### What error did you receive? _No response_ ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Safari ### Operating System Mac OSX
GiteaMirror added the bughelp wanted labels 2026-02-28 19:08:49 -06:00
Author
Owner

@Cldfire commented on GitHub (Aug 8, 2023):

Merkle hash in db: – undefined

The Merkle hash is always undefined, I'm guessing that's very much not supposed to be the case.

@Cldfire commented on GitHub (Aug 8, 2023): ``` Merkle hash in db: – undefined ``` The Merkle hash is always undefined, I'm guessing that's very much not supposed to be the case.
Author
Owner

@Cldfire commented on GitHub (Aug 9, 2023):

Full console logs as after looking at the code I realize they're pertinent to the failure here:

[Log] 16:23:18.173Reading meta... (5dbaf9ee-5da7-4255-9f7c-00768476a73b, line 1)
[Log] 16:23:18.173Got meta for documents-Actual-My-Finances-38b5b04-db.sqlite: – {size: 344064} (5dbaf9ee-5da7-4255-9f7c-00768476a73b, line 1)
[Log] 16:23:18.175Opened! (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:18.225Loaded spreadsheet from cache (712 items) (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:18.658Syncing since – "1970-01-01T00:00:00.000Z-0000-b3b2c5acce5c52c0" – 0 – "(attempt: 0)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:18.738Got messages from server – 0 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.349Syncing since – "1970-01-01T00:00:00.000Z-0000-b3b2c5acce5c52c0" – 7 – "(attempt: 0)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.427Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.453Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 1)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.520Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.543Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 2)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.611Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.629Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 3)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.693Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.709Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 4)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.775Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.790Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 5)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.857Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.871Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 6)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.936Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:35.951Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 7)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.017Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.032Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 8)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.097Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.113Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 9)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.179Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.194Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 10)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.262Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.276SENT ------- (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.276[{"timestamp":"2023-08-09T00:12:35.739Z-0000-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"name","value":"S:test"},{"timestamp":"2023-08-09T00:12:35.739Z-0001-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"offbudget","value":"N:0"},{"timestamp":"2023-08-09T00:12:35.739Z-0002-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"closed","value":"N:0"},{"timestamp":"2023-08-09T00:12:35.739Z-0003-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"sort_order","value":"N:16384"},{"timestamp":"2023-08-09T00:12:35.757Z-0000-b3b2c5acce5c52c0","dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"name","value":"S:"},{"timestamp":"2023-08-09T00:12:35.757Z-0001-b3b2c5acce5c52c0","dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"transfer_acct","value":"S:f8d8bbdb-be78-4ff2-b060-7956522e32ef"},{"timestamp":"2023-08-09T00:12:35.760Z-0000-b3b2c5acce5c52c0","dataset":"payee_mapping","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"targetId","value":"S:4ab19e8d-d8de-46bc-9225-67ed6648cee3"}] (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.276RECEIVED ------- (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.276[{"timestamp":{"_state":{"millis":1691539955739,"counter":0,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"name","value":"S:test"},{"timestamp":{"_state":{"millis":1691539955739,"counter":1,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"offbudget","value":"N:0"},{"timestamp":{"_state":{"millis":1691539955739,"counter":2,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"closed","value":"N:0"},{"timestamp":{"_state":{"millis":1691539955739,"counter":3,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"sort_order","value":"N:16384"},{"timestamp":{"_state":{"millis":1691539955757,"counter":0,"node":"b3b2c5acce5c52c0"}},"dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"name","value":"S:"},{"timestamp":{"_state":{"millis":1691539955757,"counter":1,"node":"b3b2c5acce5c52c0"}},"dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"transfer_acct","value":"S:f8d8bbdb-be78-4ff2-b060-7956522e32ef"},{"timestamp":{"_state":{"millis":1691539955760,"counter":0,"node":"b3b2c5acce5c52c0"}},"dataset":"payee_mapping","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"targetId","value":"S:4ab19e8d-d8de-46bc-9225-67ed6648cee3"}] (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.27710 – "messages:" – 7 (21) (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
{timestamp: "2023-08-09T00:12:35.739Z-0000-b3b2c5acce5c52c0", dataset: "accounts", row: "f8d8bbdb-be78-4ff2-b060-7956522e32ef", column: "name", value: "S:test"}
"res.messages:"
7
{timestamp: d, dataset: "accounts", row: "f8d8bbdb-be78-4ff2-b060-7956522e32ef", column: "name", value: "S:test"}
"clientId"
"b3b2c5acce5c52c0"
"groupId"
"7da3b8f1-8c2f-4f38-8014-89b1e824d417"
"diffTime:"
0
true
"local clock:"
"2023-08-09T00:12:45.265Z-0006-b3b2c5acce5c52c0"
undefined
"rebuilt hash:"
7
-1393416158
"server hash:"
-1393416158
"localTimeChanged:"
false
[Log] 16:23:36.279Merkle hash in db: – undefined (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.279Error: SyncError: out-of-sync (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
[Log] 16:23:36.279[Exception] (kcab.worker.61dd77d50c3de3a5c965.js, line 2)
Error: SyncError: out-of-sync
Wo — errors.ts:31
(anonymous function) — index.ts:751
@Cldfire commented on GitHub (Aug 9, 2023): Full console logs as after looking at the code I realize they're pertinent to the failure here: ``` [Log] 16:23:18.173Reading meta... (5dbaf9ee-5da7-4255-9f7c-00768476a73b, line 1) [Log] 16:23:18.173Got meta for documents-Actual-My-Finances-38b5b04-db.sqlite: – {size: 344064} (5dbaf9ee-5da7-4255-9f7c-00768476a73b, line 1) [Log] 16:23:18.175Opened! (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:18.225Loaded spreadsheet from cache (712 items) (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:18.658Syncing since – "1970-01-01T00:00:00.000Z-0000-b3b2c5acce5c52c0" – 0 – "(attempt: 0)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:18.738Got messages from server – 0 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.349Syncing since – "1970-01-01T00:00:00.000Z-0000-b3b2c5acce5c52c0" – 7 – "(attempt: 0)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.427Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.453Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 1)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.520Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.543Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 2)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.611Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.629Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 3)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.693Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.709Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 4)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.775Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.790Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 5)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.857Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.871Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 6)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.936Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:35.951Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 7)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.017Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.032Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 8)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.097Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.113Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 9)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.179Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.194Syncing since – "1970-01-01T00:00:00.000Z-0000-0000000000000000" – 7 – "(attempt: 10)" (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.262Got messages from server – 7 (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.276SENT ------- (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.276[{"timestamp":"2023-08-09T00:12:35.739Z-0000-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"name","value":"S:test"},{"timestamp":"2023-08-09T00:12:35.739Z-0001-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"offbudget","value":"N:0"},{"timestamp":"2023-08-09T00:12:35.739Z-0002-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"closed","value":"N:0"},{"timestamp":"2023-08-09T00:12:35.739Z-0003-b3b2c5acce5c52c0","dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"sort_order","value":"N:16384"},{"timestamp":"2023-08-09T00:12:35.757Z-0000-b3b2c5acce5c52c0","dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"name","value":"S:"},{"timestamp":"2023-08-09T00:12:35.757Z-0001-b3b2c5acce5c52c0","dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"transfer_acct","value":"S:f8d8bbdb-be78-4ff2-b060-7956522e32ef"},{"timestamp":"2023-08-09T00:12:35.760Z-0000-b3b2c5acce5c52c0","dataset":"payee_mapping","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"targetId","value":"S:4ab19e8d-d8de-46bc-9225-67ed6648cee3"}] (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.276RECEIVED ------- (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.276[{"timestamp":{"_state":{"millis":1691539955739,"counter":0,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"name","value":"S:test"},{"timestamp":{"_state":{"millis":1691539955739,"counter":1,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"offbudget","value":"N:0"},{"timestamp":{"_state":{"millis":1691539955739,"counter":2,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"closed","value":"N:0"},{"timestamp":{"_state":{"millis":1691539955739,"counter":3,"node":"b3b2c5acce5c52c0"}},"dataset":"accounts","row":"f8d8bbdb-be78-4ff2-b060-7956522e32ef","column":"sort_order","value":"N:16384"},{"timestamp":{"_state":{"millis":1691539955757,"counter":0,"node":"b3b2c5acce5c52c0"}},"dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"name","value":"S:"},{"timestamp":{"_state":{"millis":1691539955757,"counter":1,"node":"b3b2c5acce5c52c0"}},"dataset":"payees","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"transfer_acct","value":"S:f8d8bbdb-be78-4ff2-b060-7956522e32ef"},{"timestamp":{"_state":{"millis":1691539955760,"counter":0,"node":"b3b2c5acce5c52c0"}},"dataset":"payee_mapping","row":"4ab19e8d-d8de-46bc-9225-67ed6648cee3","column":"targetId","value":"S:4ab19e8d-d8de-46bc-9225-67ed6648cee3"}] (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.27710 – "messages:" – 7 (21) (kcab.worker.61dd77d50c3de3a5c965.js, line 2) {timestamp: "2023-08-09T00:12:35.739Z-0000-b3b2c5acce5c52c0", dataset: "accounts", row: "f8d8bbdb-be78-4ff2-b060-7956522e32ef", column: "name", value: "S:test"} "res.messages:" 7 {timestamp: d, dataset: "accounts", row: "f8d8bbdb-be78-4ff2-b060-7956522e32ef", column: "name", value: "S:test"} "clientId" "b3b2c5acce5c52c0" "groupId" "7da3b8f1-8c2f-4f38-8014-89b1e824d417" "diffTime:" 0 true "local clock:" "2023-08-09T00:12:45.265Z-0006-b3b2c5acce5c52c0" undefined "rebuilt hash:" 7 -1393416158 "server hash:" -1393416158 "localTimeChanged:" false [Log] 16:23:36.279Merkle hash in db: – undefined (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.279Error: SyncError: out-of-sync (kcab.worker.61dd77d50c3de3a5c965.js, line 2) [Log] 16:23:36.279[Exception] (kcab.worker.61dd77d50c3de3a5c965.js, line 2) Error: SyncError: out-of-sync Wo — errors.ts:31 (anonymous function) — index.ts:751 ```
Author
Owner

@Cldfire commented on GitHub (Aug 9, 2023):

Update, I have discovered that currentMerkle = merkle.insert(currentMerkle, timestamp); never seems to run in Safari in the applyMessages function for some reason. Firefox does not appear to have this issue.

Since the current Merkle is never updated we never realize that we're back in sync with the server, so syncing always fails.

@Cldfire commented on GitHub (Aug 9, 2023): Update, I have discovered that `currentMerkle = merkle.insert(currentMerkle, timestamp);` never seems to run in Safari in the `applyMessages` function for some reason. Firefox does not appear to have this issue. Since the current Merkle is never updated we never realize that we're back in sync with the server, so syncing always fails.
Author
Owner

@Cldfire commented on GitHub (Aug 9, 2023):

This seems to be the case because messages = await compareMessages(messages); is resulting in an empty messages array in Safari, in this bit here:

export const applyMessages = sequential(async (messages: Message[]) => {
  if (checkSyncingMode('import')) {
    applyMessagesForImport(messages);
    return undefined;
  } else if (checkSyncingMode('enabled')) {
    // Compare the messages with the existing crdt. This filters out
    // already applied messages and determines if a message is old or
    // not. An "old" message doesn't need to be applied, but it still
    // needs to be put into the merkle trie to maintain the hash.
    messages = await compareMessages(messages);
  }

  // ...
}
@Cldfire commented on GitHub (Aug 9, 2023): This seems to be the case because `messages = await compareMessages(messages);` is resulting in an empty `messages` array in Safari, in this bit here: ```ts export const applyMessages = sequential(async (messages: Message[]) => { if (checkSyncingMode('import')) { applyMessagesForImport(messages); return undefined; } else if (checkSyncingMode('enabled')) { // Compare the messages with the existing crdt. This filters out // already applied messages and determines if a message is old or // not. An "old" message doesn't need to be applied, but it still // needs to be put into the merkle trie to maintain the hash. messages = await compareMessages(messages); } // ... } ```
Author
Owner

@Cldfire commented on GitHub (Aug 9, 2023):

Oh nope, this is very much not a Safari-specific issue. It happens in Firefox as well. As soon as you open two tabs in the same browser instance these problems start to happen. You can also get into a situation where it says the database image is malformed until you reload the page.

Seems to be something going wrong because both tabs in the same browser are (presumably) sharing the same underlying database.

So in the case where you get the "out of sync error", the tab you click sync in goes to receive messages and apply them, but because the messages already exist in the database it thinks it's already applied them (even though it hasn't in memory). It can't handle this situation and therefore errors.

And then in other cases you just get a malformed database error and that's that.

Cross-client syncing is working fine for me as long as I don't have more than one client tab open in the same browser instance (no browser tabs sharing a database).

@Cldfire commented on GitHub (Aug 9, 2023): Oh nope, this is very much not a Safari-specific issue. It happens in Firefox as well. As soon as you open two tabs in the same browser instance these problems start to happen. You can also get into a situation where it says the database image is malformed until you reload the page. Seems to be something going wrong because both tabs in the same browser are (presumably) sharing the same underlying database. So in the case where you get the "out of sync error", the tab you click sync in goes to receive messages and apply them, but because the messages already exist in the database it thinks it's already applied them (even though it hasn't in memory). It can't handle this situation and therefore errors. And then in other cases you just get a malformed database error and that's that. Cross-client syncing is working fine for me as long as I don't have more than one client tab open in the same browser instance (no browser tabs sharing a database).
Author
Owner

@Cldfire commented on GitHub (Aug 9, 2023):

Spent some more time poking at this tonight and I feel like a service worker that handles all database interaction is the answer to this problem. That way 2+ tab scenarios all go through a shared worker and we can handle things better. It should also allow us to return to the state shown in this video: https://twitter.com/jlongster/status/1241040807093768194

@Cldfire commented on GitHub (Aug 9, 2023): Spent some more time poking at this tonight and I feel like a service worker that handles all database interaction is the answer to this problem. That way 2+ tab scenarios all go through a shared worker and we can handle things better. It should also allow us to return to the state shown in this video: https://twitter.com/jlongster/status/1241040807093768194
Author
Owner

@nardz13 commented on GitHub (Nov 5, 2025):

still seeing this issue.

@nardz13 commented on GitHub (Nov 5, 2025): still seeing this issue.
Author
Owner

@joelson-c commented on GitHub (Nov 7, 2025):

I happened to reproduce this bug while setting up #template schedule for a lot of categories (Windows 11/Chrome/Release 25.10). I gonna take a look at this in the next couple of days.

@joelson-c commented on GitHub (Nov 7, 2025): I happened to reproduce this bug while setting up `#template schedule` for a lot of categories (Windows 11/Chrome/Release 25.10). I gonna take a look at this in the next couple of days.
Author
Owner

@jbschooley commented on GitHub (Jan 10, 2026):

I see this every time I try to run 2 tabs in the same browser. Separate browser works...but it would be nice to open multiple tabs without having to sign in and download the database to every one.

@jbschooley commented on GitHub (Jan 10, 2026): I see this every time I try to run 2 tabs in the same browser. Separate browser works...but it would be nice to open multiple tabs without having to sign in and download the database to every one.
Author
Owner

@MG2R commented on GitHub (Jan 17, 2026):

Another data point. Hosted on docker, running in Firefox with multi-account containers plugin (so I can open multiple budgets at the same time). Opening the same budget twice in the same firefox container will introduce this bug. OS is Linux.

@MG2R commented on GitHub (Jan 17, 2026): Another data point. Hosted on docker, running in Firefox with multi-account containers plugin (so I can open multiple budgets at the same time). Opening the same budget twice in the same firefox container will introduce this bug. OS is Linux.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#553