Skip to content

Updating split transaction and its nested transaction will incorrectly update asset balance #76

@samfromlv

Description

@samfromlv
  1. Get an asset with balance 0
  2. Add transaction with amount 100 to this asset
  3. Observe that asset balance was correctly updated to -100
  4. Split transaction into two parts amount 50 and amount 50
  5. Observe that asset amount is still -100
  6. Update transaction with amount 120 and both parts with amount 60, issuing 3 API update calls, one for parent transaction and one for each nested transaction

EXPECTED: Asset balance now is -120
ACTUAL: Asset balance now is -140. It seems every update will cause balance update, so parent transaction is updated from 100 to 120, so -20 is added, than each part is updated from 50 to 60, so -10 is added for both, so in total balance is updated to -40. This is incorrect.

Workaround: Update parent transaction first, then for nested transaction updates use skip_balance_update flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions