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

[Bug]: Import does not properly set the account sort_order database columns #2264

Closed
1 of 5 tasks
joel-jeremy opened this issue Jan 21, 2024 · 3 comments · Fixed by #2279
Closed
1 of 5 tasks

[Bug]: Import does not properly set the account sort_order database columns #2264

joel-jeremy opened this issue Jan 21, 2024 · 3 comments · Fixed by #2279
Labels
bug Something isn't working

Comments

@joel-jeremy
Copy link
Contributor

Verified issue does not already exist?

  • I have searched and found no existing issue

Is this related to GoCardless, Simplefin or another bank-sync provider?

  • I have checked my server logs and could not see any errors there
  • I will be attaching my server logs to this issue
  • I will be attaching my client-side (browser) logs to this issue
  • I understand that this issue will be automatically closed if insufficient information is provided

What happened?

When importing a file / creating a test budget, the created accounts will have the same sort_order value in the database. This breaks the sorting functionality.

Steps to reproduce:

  1. Import a file / Create a test budget
  2. In the accounts sidebar, drag the first account and switch it with the second account
  3. The first account goes to the bottom of the accounts

This issue does is not present when a user creates a new budget, manually adds accounts and reorders the accounts.

What error did you receive?

No response

Where are you hosting Actual?

Fly.io

What browsers are you seeing the problem on?

Chrome, Other

Operating System

Mobile Device

@joel-jeremy joel-jeremy added the bug Something isn't working label Jan 21, 2024
@youngcw
Copy link
Member

youngcw commented Jan 21, 2024

It looks like the nynab importer gives unique sort values on import. It may just be the demo that they all have the same value

@youngcw
Copy link
Member

youngcw commented Jan 24, 2024

Ive been digging into this a bit. I haven't found out why the demo is different than a ynab import, but this function does the real work. It seems like, for some reason, that when creating a demo budget this function cant ever see that there were accounts previously made in order to properly request a higher sort_order value, so all the accounts in the demo get the same one.

packages/loot-core/src/server/db/index.ts#insert-account

@youngcw
Copy link
Member

youngcw commented Jan 24, 2024

I think I found the problem. Ill put in a PR

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

Successfully merging a pull request may close this issue.

2 participants