Skip to content

[Bug] store: DELETE of a record holding a transfer balance breaks the 'sum never changes' guarantee #928

Closed

Description

@jimhoyd

Found by the second agent workflow trial (#902 item 6).

Observed: the credits collection had transfers: {send: {amount: balance}, issue: {amount: balance, min: -1000000000, members: issuers}}. With DELETE added to the route's methods, the owner of a wallet with balance 100 got 204 from DELETE /api/wallets/<id>. The collection sum was then −100, not 0. The store README says the sum over the collection never changes. Activation neither warned nor refused. (PUT correctly kept the read-only balance.)

Expected: refuse deleting a record whose transfer amount is nonzero (409), or refuse DELETE on a transfers collection's mount at activation. The same rule should apply to StoreExports.delete, the operator CLI (ownerless-delete) and host transactions.

Unverified: the behavior through StoreExports.delete and the CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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