Inventory: stamp an appraisal when it arrives

The original's appraisal time was the wall clock at the moment the
appraisal came in. The reader stamped it when it first built the record,
which for a coalesced update can be minutes later; the appraisal event now
stamps it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Erik 2026-09-25 12:41:00 +02:00
parent 7a6b0a7f9d
commit c1e8a2cf18
3 changed files with 31 additions and 0 deletions

View file

@ -252,4 +252,22 @@ public sealed class InventoryFeatureTests
Assert.Empty(harness.FramesOfTypeRaw("full_inventory"));
}
[Fact]
public void The_appraisal_time_is_the_wall_clock_when_the_appraisal_arrived()
{
using var harness = new PluginHarness("Mossy");
InventoryFeature feature = LoginAndSettle(harness);
Own(harness.Host, Tachi(appraised: false));
Raise(harness.Host, 0x80000202u, PluginObjectChangeKind.Created);
Own(harness.Host, Tachi(appraised: true), TachiProps(), hostIdTime: 5000);
Raise(harness.Host, 0x80000202u, PluginObjectChangeKind.IdentReceived);
harness.Clock.Advance(TimeSpan.FromMinutes(3));
harness.Frames.Clear();
feature.FlushDirtyItems();
JObject update = JObject.Parse(harness.FramesOfTypeRaw("inventory_delta").Single());
Assert.Equal(1790325015, (int)update["item"]!["LastIdTime"]!);
}
}