From ef45e4ed828882905edea82c0540dc6b916b5cc2 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 22 Oct 2026 19:03:29 +0200 Subject: [PATCH] org.gamecult.cultlib 2.0.0: the parser's comment and the flush bullet state the exact stamp rule; declare the nil-stamp refusal (Soul s5) Co-Authored-By: Claude Opus 5.5 --- .../CultDocumentMessagePackSerialization.cs | 5 +++-- unity/org.gamecult.cultlib/CHANGELOG.md | 4 +++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/GameCult.Caching.MessagePack/CultDocumentMessagePackSerialization.cs b/src/GameCult.Caching.MessagePack/CultDocumentMessagePackSerialization.cs index b747ae36..9db26a97 100644 --- a/src/GameCult.Caching.MessagePack/CultDocumentMessagePackSerialization.cs +++ b/src/GameCult.Caching.MessagePack/CultDocumentMessagePackSerialization.cs @@ -183,8 +183,9 @@ public static class CultDocumentMessagePackSerialization } /// - /// Parses a store snapshot of any format stamp, as every release has. It judges nothing about readability: a store - /// reading its own file checks the stamp against the formats it reads, before the body is parsed. + /// Parses a store snapshot whose format stamp is a string, of any version. It refuses a nil or binary stamp + /// (1.0.61 read a nil stamp as v1). A store reading its own file checks the stamp against the formats it reads, + /// before the body is parsed. /// public static CultPersistedStoreSnapshot DeserializeSnapshot(byte[] payload) => DeserializeSnapshot(payload, _ => { }); diff --git a/unity/org.gamecult.cultlib/CHANGELOG.md b/unity/org.gamecult.cultlib/CHANGELOG.md index ebd8b9ff..f6b8c838 100644 --- a/unity/org.gamecult.cultlib/CHANGELOG.md +++ b/unity/org.gamecult.cultlib/CHANGELOG.md @@ -106,7 +106,9 @@ All notable changes to this package are documented in this file. `cultcache.store.v` with N > 4 (it threw `InvalidOperationException`). A flush rewrites any file whose stamp it can read as v1 or v2, or cannot read at all (empty, truncated, not a snapshot), which includes a v1 file whose body is corrupt or truncated. - It refuses a recognised newer stamp, and it refuses an I/O failure on the read. + It refuses any other string stamp, a nil or binary stamp, and an I/O failure on the read. + The public `DeserializeSnapshot(byte[])` still parses any string stamp, but refuses a nil + or binary stamp (1.0.61 read a nil stamp as v1). - `CultMesh.WriteSingleFileDocument` and `WriteSingleFileDocumentPayload` read the file they replace, under the store's `.lock`, and refuse (without touching it) a file this runtime cannot read, a store stamped with a newer format version,