[PR #5759] [MERGED] fix nuisance timestamp error in API #6098

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

📋 Pull Request Information

Original PR: https://github.com/actualbudget/actual/pull/5759
Author: @matt-fidd
Created: 9/21/2025
Status: Merged
Merged: 9/21/2025
Merged by: @matt-fidd

Base: masterHead: fix-sync-close


📝 Commits (2)

📊 Changes

3 files changed (+22 additions, -3 deletions)

View changed files

📝 packages/api/index.ts (+5 -1)
📝 packages/loot-core/src/server/sync/index.ts (+11 -2)
upcoming-release-notes/5759.md (+6 -0)

📄 Description

I think there might be a race that triggers this too, because I've seen it once every 100 ish calls to the API but this should sort it out. The error is caused by the crdt clock not being set, and trying to sync regardless.

Error:

TypeError: Cannot read properties of undefined (reading 'timestamp')
    at _fullSync (/Users/x/actual-api-test/node_modules/@actual-app/api/dist/app/bundle.api.js:60079:35)

Repro script:

import * as api from '@actual-app/api';

async function test() {
    await api.init({
        dataDir: './data, 
        serverURL: 'http://localhost:5006',
        password: 'password' 
    });

    await api.shutdown();
}

🔄 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/5759 **Author:** [@matt-fidd](https://github.com/matt-fidd) **Created:** 9/21/2025 **Status:** ✅ Merged **Merged:** 9/21/2025 **Merged by:** [@matt-fidd](https://github.com/matt-fidd) **Base:** `master` ← **Head:** `fix-sync-close` --- ### 📝 Commits (2) - [`2484471`](https://github.com/actualbudget/actual/commit/248447119cb24f989790817c40ae14c8b58d78f7) skip sync on api shutdown if no budget loaded - [`c14f3d5`](https://github.com/actualbudget/actual/commit/c14f3d500ddb91384e27accb974bec344d77ede4) note ### 📊 Changes **3 files changed** (+22 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/api/index.ts` (+5 -1) 📝 `packages/loot-core/src/server/sync/index.ts` (+11 -2) ➕ `upcoming-release-notes/5759.md` (+6 -0) </details> ### 📄 Description I _think_ there might be a race that triggers this too, because I've seen it once every 100 ish calls to the API but this should sort it out. The error is caused by the crdt clock not being set, and trying to sync regardless. Error: ``` TypeError: Cannot read properties of undefined (reading 'timestamp') at _fullSync (/Users/x/actual-api-test/node_modules/@actual-app/api/dist/app/bundle.api.js:60079:35) ``` Repro script: ```js import * as api from '@actual-app/api'; async function test() { await api.init({ dataDir: './data, serverURL: 'http://localhost:5006', password: 'password' }); await api.shutdown(); } ``` --- <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:23:53 -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#6098