Giter VIP home page Giter VIP logo

Comments (6)

lelemm avatar lelemm commented on June 26, 2024

Linking to closed issue due missing information: #2241

from actual.

lelemm avatar lelemm commented on June 26, 2024

image

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

from actual.

MatissJanis avatar MatissJanis commented on June 26, 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.

function topologicalSortUntil(name, visited, sorted) {
visited.add(name);
const iter = adjacent(name).values();
let cur = iter.next();
while (!cur.done) {
if (!visited.has(cur.value)) {
topologicalSortUntil(cur.value, visited, sorted);
}
cur = iter.next();
}
sorted.unshift(name);
}

from actual.

lelemm avatar lelemm commented on June 26, 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.

from actual.

lelemm avatar lelemm commented on June 26, 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

from actual.

lelemm avatar lelemm commented on June 26, 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.

from actual.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.