[GH-ISSUE #2387] [Bug]: RangeError: Maximum call stack size exceeded. when openning the application #50065

Closed
opened 2026-04-30 12:58:49 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @lelemm on GitHub (Feb 22, 2024).
Original GitHub issue: https://github.com/actualbudget/actual/issues/2387

Verified issue does not already exist?

  • I have searched and found no existing issue
  • 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?

Imported some OFX with no problems, then I imported an CSV, categorized its transactions. Tried to go to budget, this error starts happening. Now I'm unable to open the application at all.

What error did you receive?

graph-data-structure.ts:79 Uncaught (in promise) RangeError: Maximum call stack size exceeded
at ep (graph-data-structure.ts:79:13)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)
at ep (graph-data-structure.ts:85:9)

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Chrome, Microsoft Edge

Operating System

Windows 11

Originally created by @lelemm on GitHub (Feb 22, 2024). Original GitHub issue: https://github.com/actualbudget/actual/issues/2387 ### Verified issue does not already exist? - [X] 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? Imported some OFX with no problems, then I imported an CSV, categorized its transactions. Tried to go to budget, this error starts happening. Now I'm unable to open the application at all. ### What error did you receive? graph-data-structure.ts:79 Uncaught (in promise) RangeError: Maximum call stack size exceeded at ep (graph-data-structure.ts:79:13) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) at ep (graph-data-structure.ts:85:9) ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Chrome, Microsoft Edge ### Operating System Windows 11
GiteaMirror added the bug label 2026-04-30 12:58:49 -05:00
Author
Owner

@lelemm commented on GitHub (Feb 22, 2024):

Linking to closed issue due missing information: #2241

<!-- gh-comment-id:1959383602 --> @lelemm commented on GitHub (Feb 22, 2024): Linking to closed issue due missing information: #2241
Author
Owner

@lelemm commented on GitHub (Feb 22, 2024):

image

https://github.com/actualbudget/actual/files/14165218/crash.csv

<!-- gh-comment-id:1959388747 --> @lelemm commented on GitHub (Feb 22, 2024): ![image](https://github.com/actualbudget/actual/assets/15043428/0841c309-103f-46d7-aa9b-62633fa79339) [https://github.com/actualbudget/actual/files/14165218/crash.csv](https://github.com/actualbudget/actual/files/14165218/crash.csv)
Author
Owner

@MatissJanis commented on GitHub (Mar 15, 2024):

Ok, so it took me quite a while to get to the bottom of this. The crux of the problem is - transactions created WAYYYY in the past cause issues with budget table calculations. The simple fix for you would be - don't import transactions from 1980. Use the last few years.

To proper patch this we need to refactor topological sorting from a recursive implementation to an iterative one.

c82a6dc5ef/packages/loot-core/src/server/spreadsheet/graph-data-structure.ts (L79-L92)

<!-- gh-comment-id:1999147680 --> @MatissJanis commented on GitHub (Mar 15, 2024): Ok, so it took me quite a while to get to the bottom of this. The crux of the problem is - transactions created WAYYYY in the past cause issues with budget table calculations. The simple fix for you would be - don't import transactions from 1980. Use the last few years. To proper patch this we need to refactor topological sorting from a recursive implementation to an iterative one. https://github.com/actualbudget/actual/blob/c82a6dc5efcb540dd4e1ffedf18701229be9caa5/packages/loot-core/src/server/spreadsheet/graph-data-structure.ts#L79-L92
Author
Owner

@lelemm commented on GitHub (Mar 19, 2024):

Yeah, I imagined the problem was that.
A suggestion is to set a limit to the past where is "old enough" to actual keeps working.
In other words, if the user sets a date to much in the past, don't save it.

It's better to have this kind of lock cuz I see this as critical bug. The file is exported from the bank that way. If you don't pay enough attention when doing it, you just lose your instance or have to edit the database file by hand.

<!-- gh-comment-id:2006987551 --> @lelemm commented on GitHub (Mar 19, 2024): Yeah, I imagined the problem was that. A suggestion is to set a limit to the past where is "old enough" to actual keeps working. In other words, if the user sets a date to much in the past, don't save it. It's better to have this kind of lock cuz I see this as critical bug. The file is exported from the bank that way. If you don't pay enough attention when doing it, you just lose your instance or have to edit the database file by hand.
Author
Owner

@lelemm commented on GitHub (Mar 19, 2024):

Out of curiosity, I tried to see how far back we have to go to break the current code:
Considering today 19-03-2024, I had to put 19-03-2028 to have the same error, that's 96 years to the past. So, if you check if the transaction is more than 90 years old, we are safe.

This creates a interesting bug (hardly able to see by us): If I starting using actual today, it will fail to load at 19/03/2120. lol

<!-- gh-comment-id:2007717943 --> @lelemm commented on GitHub (Mar 19, 2024): Out of curiosity, I tried to see how far back we have to go to break the current code: Considering today 19-03-2024, I had to put 19-03-2028 to have the same error, that's 96 years to the past. So, if you check if the transaction is more than 90 years old, we are safe. This creates a interesting bug (hardly able to see by us): If I starting using actual today, it will fail to load at 19/03/2120. lol
Author
Owner

@lelemm commented on GitHub (Mar 19, 2024):

This would be the workaround I was thinking about.

I didn't try to run this code, I just forked and tried pinpoint where should be the change I suggested.

Since actual has syncing features for offline use, I can imagine there is a better/another place to make the same change.

<!-- gh-comment-id:2007793299 --> @lelemm commented on GitHub (Mar 19, 2024): This would be the [workaround](https://github.com/lelemm/actual/commit/7cc34437074e0e2aabcbec2e42d50e31cc33cc02) I was thinking about. I didn't try to run this code, I just forked and tried pinpoint where should be the change I suggested. Since actual has syncing features for offline use, I can imagine there is a better/another place to make the same change.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#50065