Skip to content

The "Vanish" Crash #5

@sengardeep

Description

@sengardeep

Problem

The wallet transfer process is not atomic.
If the system crashes or an error occurs after debiting Alice but before crediting Bob, the transfer ends in an inconsistent state where money is effectively lost.
This results in partial updates that violate financial integrity.

Points: 40

Steps to Reproduce

  1. Initiate a transfer from Alice to Bob.
  2. Allow the debit operation on Alice’s balance to complete.
  3. Force a crash or simulate an exception before the credit operation executes for Bob.
  4. Notice:
    • Alice’s balance decreases.
    • Bob’s balance does not increase.
    • The system has lost money due to the incomplete transaction.

Expected Behavior

Transfers must be fully atomic:

  • Both operations (debit and credit) should succeed together, or
  • Both should be rolled back if any part fails.

To fix this, implement:

  • Database transactions (MongoDB sessions / SQL transactions), or
  • An equivalent atomic mechanism ensuring transfer operations are grouped and committed as one unit.

No transfer should ever result in partial updates or lost funds.

Submission Guidelines

  1. Comment on this issue with your proposed solution approach.
  2. Wait for issue assignment from reviewers.
  3. Create a PR with clear, descriptive commit messages.
  4. Reference this issue in your PR description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Mediummedium issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions