-
Notifications
You must be signed in to change notification settings - Fork 5
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
Amount parsing crashes when the amount contains only an assertion #187
Comments
After clearing the NanoLedger's storage and cache NanoLedger v0.6.0 opens without issue. However, the app crashes immediately after configuring the file in Settings » File by setting it to my ledger file (.txt) on my Nextcloud instance (content://org.nextcloud.documents/document/[string of numbers, letters and special charactes, e.g. % ] |
Hmm, that's not great. Since I had to parse the amounts for the edit functionality, I probably didn't cover an edge case there. How familiar are you with android development? Any chance you could use And I know this is a lot to ask, but any chance you could share your journal file? If you don't want to share the whole file, you could try to minimise a reproduction sample by throwing away half of the transactions and seeing if the bug still occurs. If it does, keep going, if it doesn't, take the other half and keep going with those transactions. |
I am not familiar with Android development, unfortunately. However, I tried my best with As you suggested, I tried to reproduce the crashes with a reduced ledger file. Iterating over my hledger-file, it turned out that my opening balance statement was the culprit. Setting opening balances according to https://hledger.org/1.40/hledger.html#setting-opening-balances does work in NanoLedger v0.6.0: include ./accounts.txt
include ./commodities.txt
include ./prices.txt
include ./budget.txt
; Setting opening balances according to https://hledger.org/1.40/hledger.html#setting-opening-balances does work in NanoLedger v0.6.0
2016/1/1 opening balances
assets:checking $409.32 = $409.32
assets:savings $735.24 = $735.24
assets:cash $42 = $42
equity:opening balances Setting opening balances according to https://hledger.org/1.40/hledger.html#balance-assignments does not work in NanoLedger v0.6.0: include ./accounts.txt
include ./commodities.txt
include ./prices.txt
include ./budget.txt
; Setting opening balances according to https://hledger.org/1.40/hledger.html#balance-assignments does not work in NanoLedger v0.6.0
2016/1/1 opening balances
assets:checking = $409.32
assets:savings = $735.24
assets:cash = $42
equity:opening balances So the problem seems to be the parsing of Ledger-style balance assignments. |
Ah right, that's a thing as well. I'll try to work on a fix ASAP. |
Thanks for the help in diagnosing this issue! I worked on a fix in #188. Could you give the following APK a try? https://github.com/chvp/NanoLedger/actions/runs/11201905084/artifacts/2020684183 |
I'm happy to report that your solution resolved this issue. Thank you so much for your quick response and fix! |
Great! I pushed the tag for a new release, it should be created automatically in a few minutes. |
Reproduction steps
Expected behaviour
Keep working as reliably as the previous versions.
System information
Additional Context
My ledger is synced via Nextcloud.
Last, but not least, I want to take a moment to express my gratitude for your hard work and dedication to this amazing app. NanoLedger helps make plain text accounting a breeze.
The text was updated successfully, but these errors were encountered: