Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleared status resets on re-import #20

Open
Yumekui opened this issue Jan 7, 2025 · 5 comments
Open

cleared status resets on re-import #20

Yumekui opened this issue Jan 7, 2025 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@Yumekui
Copy link

Yumekui commented Jan 7, 2025

Issue:
When importing transactions a second time, their cleared status is reset to false. I have the setting import.synchronizeClearedStatus set to false.

Expected Behavior:
The cleared status should not be reset when re-importing transactions, as per my current configuration.

Reference:
According to the Actual Budget API documentation, setting the cleared status is not required. However, convertToActualTransaction sets cleared to false when the import.synchronizeClearedStatus setting is false:

private async convertToActualTransaction(
transaction: MonMonTransaction
): Promise<CreateTransaction> {
return {
date: format(transaction.valueDate, 'yyyy-MM-dd'),
amount: Math.round(transaction.amount * 100),
imported_id: this.getIdForMoneyMoneyTransaction(transaction),
imported_payee: transaction.name,
cleared: this.config.import.synchronizeClearedStatus
? transaction.booked
: false,
notes: transaction.purpose,
// payee_name: transaction.name,
};
}

Additional Information:
I'm not proficient in JavaScript but can test this behavior further once I have set up a suitable environment, which may take some time.

Please let me know if additional details are required. Thank you!

@NikxDa
Copy link
Owner

NikxDa commented Jan 7, 2025

Hi @Yumekui,

thanks for reporting this. I will have to check whether Actual skips updating the cleared flag if I pass undefined instead of false, which I would assume it should do. If it does, I will release a bugfix release that solves this shortly.

@NikxDa
Copy link
Owner

NikxDa commented Jan 7, 2025

I've had a look at this tonight and it turns out that Actual defaults the cleared flag to true (see here), which means that if I do not provide it as false, it will be reset to true instead. This is of course similarly useless behavior.

My opinion is that the defaults should only apply when creating transactions in Actual, not when updating. I will raise this with the Actual team and put this ticket on hold until then.

@Yumekui
Copy link
Author

Yumekui commented Jan 7, 2025

Thanks for looking into this! I agree with you - defaulting the cleared flag to true when updating doesn’t seem right. Makes sense to check with the Actual team. Appreciate your help!

@NikxDa
Copy link
Owner

NikxDa commented Jan 15, 2025

@Yumekui Good news! My proposed changes to the API implementation were merged earlier today, so on the next API release in February, I'll be able to hook this up on the importer side as well. Stay tuned :)

@NikxDa NikxDa removed the on hold Work on this issue is paused label Jan 15, 2025
@NikxDa NikxDa added this to the 2.8.0 milestone Jan 15, 2025
@Yumekui
Copy link
Author

Yumekui commented Jan 16, 2025

Oh wow. That's really great news! Thank you very much for your fast response and all the work you put into this. This will make managing my finances much easier. Keep up the great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants