Skip to content

Create Mobile Wallet Test Host #158

@StuartFerguson

Description

@StuartFerguson

This needs some extra stuff added to it

  1. You DO NOT have transaction safety yet

Right now:

await wallet.Debit(...)
await wallet.Credit(...)

This is not atomic

Real fix:

Use DB transaction:

using var tx = await db.Database.BeginTransactionAsync();

  1. No concurrency control

Two requests could:

read same balance
both debit
→ double spend
Real fix:
RowVersion (optimistic concurrency)
OR SQL locking (FOR UPDATE equivalent)

  1. Webhooks are not retry-persistent anymore

You lost:

retry queue persistence

Right now:

fire-and-forget again

  1. No indexes on hot paths

You should add:

b.Entity()
.HasIndex(t => t.Created);

b.Entity()
.HasIndex(i => new { i.Type, i.Value });

Metadata

Metadata

Assignees

No one assigned

    Labels

    taskTasks and work items

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions