Fix serializable files not always getting written on change

In some cases, STJ might decide to replace the object rather than populating it. This will work for majority of properties and use cases, however, we actually set up events on some properties to notify us back if they change during runtime. That event registration did not work properly, as the object was replaced with the new, that did not have appropriate listeners set up.

Populate rather than replacing those selected properties, which fixes the problem.
This commit is contained in:
Łukasz Domeradzki
2025-06-28 13:10:13 +02:00
parent e9887cf89e
commit 08fb3ccb76
3 changed files with 11 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ namespace ArchiSteamFarm.OfficialPlugins.ItemsMatcher;
internal sealed class BotCache : SerializableFile {
[JsonDisallowNull]
[JsonInclude]
[JsonObjectCreationHandling(JsonObjectCreationHandling.Populate)]
internal ConcurrentList<AssetForListing> LastAnnouncedAssetsForListing { get; private init; } = [];
internal string? LastAnnouncedTradeToken {