Repository navigation
Conversation
…heme styles The music, sound and nested clip animation keys, animgraph and theme style formats from #2279, #2284, #2286 and #2302 accepted files they could not use: a NaN tempo, transitions, next clips and states naming clips or states that do not exist, unknown transition points, layer modes and parameter types, a blend driven by a trigger, nested or null event arguments, sound and clip keys outside the clip or outside the project, and style boxes with an unknown kind or color. Each is now refused with a *loaderr.Error naming the field. Theme style box borders are a {width, color} stroke and variations may set a font, as #1422 specifies; a string border and a variation font were refused before. The animgraph, sound and music kinds get their doc comments back, and Parse and the package doc list them. The theme style boxes section of docs/en and docs/zh gameui.md that the merge dropped is restored.
With WithSeal, Load verified the seal only when the envelope had one, so deleting the seal field was all an edit needed to load, which defeated #1655's tamper evidence. A copy without a seal is now a mismatch; SealOptions.AcceptUnsealed loads saves written before sealing was turned on, which the next Save seals. SealRefuse, SealReport and the SealOptions fields get doc comments, and docs/en and docs/zh save.md describe the seal in one section instead of splitting it across the migrations example.
#2251 wrapped only core.StorageFullError, so FileBackend's ENOSPC (ERROR_DISK_FULL on Windows) and a file-backed SettingsStore never matched ErrStorageFull, though the docs promise it across storage backends.
DiagnosticError reported ErrNotFound and ErrStorageFull as unknown, ErrMissingMigration as recoverable, and ErrTampered as corrupt. The codes are now not_found, storage_full, missing_migration (not recoverable) and tampered, and LoadDiagnostic, DirtyState and the CloseDecision constants get doc comments.
Contributor
Author
|
Focused source checks are clean on current head 91eb14d against origin/main 072b8df: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up review of the resource and save pull requests the merge train landed without CI.
Reviewed pull requests
#2279 feat(resource): add adaptive music format
Landed intact, but
Music.Validateaccepted files the format cannot play: a NaN or infinitebpm, clips with neither a source nor stems, anext,from,toorvianaming a clip that does not exist, anyatstring, and negative fades or crossfade. This PR checks each of them with a*loaderr.Errornaming the field (from: "*"stays allowed, as #1400 specifies). #1400 stays open: playback,game checkandgame mvare follow-ups.#2280 feat(resource): add sound cue resources
OK. The merge dropped the doc comments on
KindAnimGraph,KindSoundandKindMusic, andParse's fix text and the package doc still listed the kinds without animgraph and music; both are fixed here.#2284 feat(resource): add advanced animation tracks
soundsandclipskeys were not validated at all (times outside the clip or out of order, paths outside the project, an empty clip), and eventargsaccepted nested maps and null although the docs say scalar. They are now refused.SoundKey,ClipKey,Animation.Sounds/ClipsandEvent.Argsget doc comments.#2286 feat(resource): add 3D animation graph format
The
from, to/clip, firetag bug was already fixed on main. Validation only checked the model path, parameter names and layer names. It now also checks parameter types (float,bool,trigger), unique layer names, exactly one ofmachineandoneShotper layer, unique state names,entryand transitions naming states, a state's clip orblend1d, blends driven by a declared float parameter with finite increasing samples, one-shots fired by a declared trigger, mask weight in [0, 1], layermode(override/additive), and non-negative fades.#2302 feat(resource): add theme style boxes and variations
The merge dropped the "Theme style boxes" section from docs/en and docs/zh
gameui.md; restored. The format did not match #1422:borderwas a string where the issue specifies{width, color}, and a variation could not setfont, so the issue's own example was refused. Style boxes were not validated (kind, colors, radius, image). This PR addsStyleBorder,ThemeVariation.Font, style box validation, font validation for types and variations, and doc comments on the new fields. The round-trip test now checks that encoding is stable.#2115 feat(save): add tamper-evident per-install seals
Code landed intact, but there is a security hole:
Loadverified the seal only when the envelope had one, so deleting thesealfield was all an edit needed to load. A copy without a seal is now a mismatch; the newSealOptions.AcceptUnsealedkeeps the legacy upgrade path (#1655: "unsealed saves upgrade") as an explicit opt-in. The docs paragraph the merge put between the migrations sentence and its code example moves into the tamper-evident section, which now also says the header is not sealed and what the seal does not protect against.SealRefuse/SealReportand theSealOptionsfields get doc comments, and the implementation note is updated.#2251 fix(save): normalize storage full errors
The docs line was dropped by the merge; restored.
ErrStorageFullonly wrapped*core.StorageFullError, soFileBackend'sENOSPC(ERROR_DISK_FULL/ERROR_HANDLE_DISK_FULLon Windows) and a file-backedSettingsStorenever matched it, although the docs promise it across backends. Both are wrapped now. The PR saidCloses #1569, butLoadInfo/FromBackup, the quarantine copy and its tests are not implemented, so #1569's acceptance is not met.#2353 feat(save): add stable load diagnostics
The docs and changelog were released with 0.4.0 and moved to
save.md, which is fine.DiagnosticErrorreportedErrNotFoundandErrStorageFullasunknown, a missing migration as recoverable, and a tampered save ascorrupt. They now getnot_found,storage_full,missing_migration(not recoverable) andtampered, and the codes are documented.#2358 feat: add unsaved progress close policy
The docs line was dropped by the merge; restored, and the
CloseDecisionconstants get doc comments. The PR saidCloses #1574, but it only adds the three-valueDirtyState.Decide: nogame.GuardQuit, no quit or window-close handling, no dialog and no template changes, so #1574's acceptance is not met.#2407 feat: add save migration registry
The "Migration registries" docs section was dropped by the merge; restored. The code is OK.
MigrationRegistryis not used byStore, which keeps its ownMigrationsmap. It is the start of #1541's format registry, so it stays.Verification
go tool nsgo test ./pkg/resource/... ./pkg/save/...(blackmac): all passgo tool nsgo check ./pkg/save/...,go tool nsgo check ./pkg/resource/...;GOOS=windowsandGOOS=js GOARCH=wasmgo vet ./pkg/save/go tool nsgo test ./internal/repocheck/...: passbun run verify-notes,go run ./tools/changelog checkNo open pull request touches these files.
Screenshots: None