fix(gift): drop RowVersion (SQLite incompatible) + restore wire reward_type map
[Timestamp] byte[] doesn't work under SQLite (the test backend) — EF expects the DB to populate it on insert, but SQLite has no equivalent of Postgres's xmin. The WHERE Status = Unclaimed filter plus IInventoryService's viewer-level concurrency is the practical defense; RowVersion was only a backstop. Regenerated the migration without the RowVersion column. Wire reward_type on the gift endpoint uses a gift-specific scheme that diverges from UserGoodsType for currencies: wire 1 = Crystal (enum=2), wire 9 = Rupy (enum=9), wire 4 = Item (enum=4). A naked cast resolves wire 1 to UserGoodsType.RedEther and silently grants the wrong wallet — restored the explicit WireRewardTypeToUserGoodsType map from the old tutorial controller. Retrofits existing GiftControllerTests to call SeedTutorialPresentsAsync on the new helper (RegisterViewer doesn't auto-seed; only the prod signup path does). All 7 existing tests pass.
This commit is contained in:
@@ -2899,12 +2899,6 @@ namespace SVSim.Database.Migrations
|
||||
b.Property<int>("RewardType")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<byte[]>("RowVersion")
|
||||
.IsConcurrencyToken()
|
||||
.IsRequired()
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<string>("Source")
|
||||
.HasMaxLength(64)
|
||||
.HasColumnType("character varying(64)");
|
||||
|
||||
Reference in New Issue
Block a user