[GH-ISSUE #7282] [Bug]: Initial bank sync account linking does not save last sync time #9972

Closed
opened 2026-04-10 20:19:11 -05:00 by GiteaMirror · 7 comments
Owner

Originally created by @JkBoyo on GitHub (Mar 25, 2026).
Original GitHub issue: https://github.com/actualbudget/actual/issues/7282

What happened?

I was trying to setup Actual with bank imports using just the SimpleFin bridge.

I expected the bank sync date to update when the accounts updated but it never has.

There were no errors displayed just Unknown on the bank sync screen for last sync date.

When I hovered the Unknown it showed what looks like the 0 date value in most time based libraries of Dec 31 1969 1900.

Image

Feel free to ping me and ask me any questions.

I did test this on both Brave and Chrome as I was worried my browser of choice could be causing it and it wasn't.

How can we reproduce the issue?

  1. I setup the docker container.
  2. Bought the SimpleFin subscription
  3. Added accounts on SimpleFin
  4. Moved back over to actual budget
  5. Went to import accounts and clicked on add accounts through SimpleFin
  6. Clicked on sync accounts for all accounts connected this way picking both on and off budget
  7. Waited a day or two and never saw the last synced date update but did notice new un-categorized transactions occurring.
  8. Did notice actual new transactions from yesterday.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Other

Operating System

Linux

Originally created by @JkBoyo on GitHub (Mar 25, 2026). Original GitHub issue: https://github.com/actualbudget/actual/issues/7282 ### What happened? I was trying to setup Actual with bank imports using just the SimpleFin bridge. I expected the bank sync date to update when the accounts updated but it never has. There were no errors displayed just Unknown on the bank sync screen for last sync date. When I hovered the Unknown it showed what looks like the 0 date value in most time based libraries of Dec 31 1969 1900. <img width="520" height="594" alt="Image" src="https://github.com/user-attachments/assets/12bab7f4-ecbd-4f67-b02c-5f1bd3e99ee4" /> Feel free to ping me and ask me any questions. I did test this on both Brave and Chrome as I was worried my browser of choice could be causing it and it wasn't. ### How can we reproduce the issue? 1. I setup the docker container. 2. Bought the SimpleFin subscription 3. Added accounts on SimpleFin 4. Moved back over to actual budget 5. Went to import accounts and clicked on add accounts through SimpleFin 6. Clicked on sync accounts for all accounts connected this way picking both on and off budget 7. Waited a day or two and never saw the last synced date update but did notice new un-categorized transactions occurring. 8. Did notice actual new transactions from yesterday. ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Other ### Operating System Linux
GiteaMirror added the bank syncbug labels 2026-04-10 20:19:11 -05:00
Author
Owner

@youngcw commented on GitHub (Mar 25, 2026):

Does it update if you click "Bank sync" in the account page?

<!-- gh-comment-id:4127409609 --> @youngcw commented on GitHub (Mar 25, 2026): Does it update if you click "Bank sync" in the account page?
Author
Owner

@JkBoyo commented on GitHub (Mar 25, 2026):

Sorry I haven't replied to this sooner.

I guess the weirdness to me is that the account transactions did update before before I clicked on Bank Sync. I don't know if it was triggered by importing new accounts and then the new transactions were also brought in but it seemed weird that linking wouldn't be considered a sync since it was a direct pull from the bank account.

Is there a reason we don't count the initial import as a Bank Sync?

<!-- gh-comment-id:4127810741 --> @JkBoyo commented on GitHub (Mar 25, 2026): Sorry I haven't replied to this sooner. I guess the weirdness to me is that the account transactions did update before before I clicked on Bank Sync. I don't know if it was triggered by importing new accounts and then the new transactions were also brought in but it seemed weird that linking wouldn't be considered a sync since it was a direct pull from the bank account. Is there a reason we don't count the initial import as a `Bank Sync`?
Author
Owner

@youngcw commented on GitHub (Mar 25, 2026):

You must have linked other accounts. I think that triggers a sync on all accounts.

It was never added to the code to save the time after linking an account. Thats what most things are in open source, it was just never added. Simple as that

<!-- gh-comment-id:4127826914 --> @youngcw commented on GitHub (Mar 25, 2026): You must have linked other accounts. I think that triggers a sync on all accounts. It was never added to the code to save the time after linking an account. Thats what most things are in open source, it was just never added. Simple as that
Author
Owner

@JkBoyo commented on GitHub (Mar 25, 2026):

Makes total sense. Are the functions pretty easy to find for the account linking?

I mainly know golang but would be willing to try to mess with the sqlite insert to get the initial link as a sync

<!-- gh-comment-id:4127842293 --> @JkBoyo commented on GitHub (Mar 25, 2026): Makes total sense. Are the functions pretty easy to find for the account linking? I mainly know golang but would be willing to try to mess with the sqlite insert to get the initial link as a sync
Author
Owner

@JkBoyo commented on GitHub (Mar 25, 2026):

Just didn't want to step on toes if there was another reason.

<!-- gh-comment-id:4127848147 --> @JkBoyo commented on GitHub (Mar 25, 2026): Just didn't want to step on toes if there was another reason.
Author
Owner

@matt-fidd commented on GitHub (Mar 25, 2026):

Makes total sense. Are the functions pretty easy to find for the account linking?

I mainly know golang but would be willing to try to mess with the sqlite insert to get the initial link as a sync

You're welcome to take a look!

Here's where the timestamp is saved in the normal flow, the initial linking flow mustn't go through this function.

acb339be90/packages/loot-core/src/server/accounts/app.ts (L843-L870)

All of the linking functions are defined in the same file, using the SimpleFIN one as an example:
acb339be90/packages/loot-core/src/server/accounts/app.ts (L217-L287)

The normal flow appears to use the response from syncAccount and feed it back through handleSyncResponse. The linking functions don't seem to do that. There could be a reason we haven't done this, but putting it through would fix the timestamp thing.

I haven't looked any deeper than finding the functions, but hopefully that's useful for you!

<!-- gh-comment-id:4129881866 --> @matt-fidd commented on GitHub (Mar 25, 2026): > Makes total sense. Are the functions pretty easy to find for the account linking? > > I mainly know golang but would be willing to try to mess with the sqlite insert to get the initial link as a sync You're welcome to take a look! Here's where the timestamp is saved in the normal flow, the initial linking flow mustn't go through this function. https://github.com/actualbudget/actual/blob/acb339be9029b5950bbfc239edbe19330d8028a2/packages/loot-core/src/server/accounts/app.ts#L843-L870 All of the linking functions are defined in the same file, using the SimpleFIN one as an example: https://github.com/actualbudget/actual/blob/acb339be9029b5950bbfc239edbe19330d8028a2/packages/loot-core/src/server/accounts/app.ts#L217-L287 The normal flow appears to use the response from `syncAccount` and feed it back through `handleSyncResponse`. The linking functions don't seem to do that. There could be a reason we haven't done this, but putting it through would fix the timestamp thing. I haven't looked any deeper than finding the functions, but hopefully that's useful for you!
Author
Owner

@JkBoyo commented on GitHub (Mar 26, 2026):

Looking through the code it seems like the simplest solution would be to capture the output of lines
acb339be90/packages/loot-core/src/server/accounts/app.ts (L199)
acb339be90/packages/loot-core/src/server/accounts/app.ts (L271)
And
acb339be90/packages/loot-core/src/server/accounts/app.ts (L343)
Then run them through handleSyncResponse that you mentioned above.

However, it feels like for most of these 3 calls we could extract a majority of the logic and make it easier to setup another link function if we ever wanted to add another service or have to swap one out due to problems.

The one thing I couldn't fully wrap my head around was the full why behind simpleFinBatchSync on acb339be90/packages/loot-core/src/server/accounts/app.ts (L1013).

It really seemed initially like it would be nice and easy to just make all bankSyncs just do the db update and call it a day but that function uses the handleSyncResponse but not the bank sync function. This made me think that maybe we could do a localized wholeBankSync function that could wrap both so we just have one thing we're calling unless we're in the above simpleFinBatchSync.

So instead of trying to pick a direction on not my codebase I thought I'd ask your opinion 🫠.

<!-- gh-comment-id:4136874063 --> @JkBoyo commented on GitHub (Mar 26, 2026): Looking through the code it seems like the simplest solution would be to capture the output of lines https://github.com/actualbudget/actual/blob/acb339be9029b5950bbfc239edbe19330d8028a2/packages/loot-core/src/server/accounts/app.ts#L199 https://github.com/actualbudget/actual/blob/acb339be9029b5950bbfc239edbe19330d8028a2/packages/loot-core/src/server/accounts/app.ts#L271 And https://github.com/actualbudget/actual/blob/acb339be9029b5950bbfc239edbe19330d8028a2/packages/loot-core/src/server/accounts/app.ts#L343 Then run them through handleSyncResponse that you mentioned above. However, it feels like for most of these 3 calls we could extract a majority of the logic and make it easier to setup another link function if we ever wanted to add another service or have to swap one out due to problems. The one thing I couldn't fully wrap my head around was the full why behind simpleFinBatchSync on https://github.com/actualbudget/actual/blob/acb339be9029b5950bbfc239edbe19330d8028a2/packages/loot-core/src/server/accounts/app.ts#L1013. It really seemed initially like it would be nice and easy to just make all bankSyncs just do the db update and call it a day but that function uses the handleSyncResponse but not the bank sync function. This made me think that maybe we could do a localized wholeBankSync function that could wrap both so we just have one thing we're calling unless we're in the above simpleFinBatchSync. So instead of trying to pick a direction on not my codebase I thought I'd ask your opinion 🫠.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#9972