Release: develop -> main#4371
Merged
Merged
Conversation
…ng residue (#4357) (#4362) * fix(bank): resolve an internal bank account by its asset link (#4357) A (name, currency) pair can match more than one bank row. Resolving it to the newest row alone lets a row that is linked to no asset take over the identity of the linked account, after which per-asset matching no longer recognises the IBAN carried by the already booked transactions of that account. Prefer the asset-linked row and keep the newest-row rule as the fallback when no row of that key is linked, so a stale legacy row still cannot win. An ambiguous key (several rows with different IBANs) is now logged once when the cache is loaded, with row ids only. * fix(log): report pending-leg anomalies only beyond the balance tolerance (#4357) The filtered-vs-unfiltered comparisons used exact inequality and the negative checks used a plain sign test, so a floating-point summation residue from aggregating large pending amounts was reported as a reconciliation anomaly on every job run. Both now report only beyond the existing balance tolerance. Clamping to zero is unchanged for any negative value; only the reporting is gated. * fix(log): scale the reporting tolerance to the asset's amount type (#4357) A cent-sized tolerance is right for a EUR/USD/CHF-denominated bank position but would be a material amount on a high-priced asset, where it could hide a genuinely wrong balance instead of a summation residue. The reporting threshold now follows the asset's amount type: the existing balance tolerance for fiat-denominated positions, and the 8-decimal granularity these amounts are logged at for everything else. Fiat-ness is read from the financial type, the same way this log already picks the rounding for an amount. * test(log): pin the asset-dependent reporting tolerance with a paired case (#4357) The two separate tolerance tests could not tell the branch apart: on a fiat-denominated asset the asset-dependent threshold and the previous flat one are the same value, so the fiat case passed either way. One paired case now runs both assets through the same call with the same deviation, so the only thing that differs is the amount type — and the case fails against the previous behaviour. * refactor(bank): group bank rows with the shared helper (#4357) The per-key grouping in the iban cache rebuilt what the shared grouping helper already does, and that helper preserves input order within a group, so the newest-first ordering the selection relies on is unchanged. * test(log): make the residue cases exercise the fiat threshold they name (#4357) The three residue cases named the fiat tolerance but their fixtures carried no financial type, so they took the asset branch instead; with amounts far outside the band between the two thresholds they passed either way. They now set the financial type they describe, and one of them additionally pins the fiat threshold with a deviation inside that band.
github-actions
Bot
requested review from
TaprootFreak and
davidleomay
as code owners
July 24, 2026 14:05
Author
ℹ️ New TODOs/FIXMEs (1)+ address: yapealEUR.bic.padEnd(11, 'XXX'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic Release PR
This PR was automatically created after changes were pushed to develop.
Commits: 1 new commit(s)
Checklist