Skip to content

fix: close remaining review items in runtime and Studio - #33

Merged
rendis merged 1 commit into
mainfrom
issue/wonderful-fermi-8r8eid
Oct 5, 2026
Merged

rendis merged 1 commit into
mainfrom
issue/wonderful-fermi-8r8eid

Conversation

@rendis

@rendis rendis commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

These are the last minor findings from the review of PRs #22–#24.

Runtime: contextMutex.Unlock on an unlocked mutex panics

Before this change, a second Unlock blocked forever on the full token channel, which hid the bug as a deadlock. It now panics, the same way sync.Mutex does. The new test TestRuntime_UnlockSinLockEntraEnPanicEnVezDeBloquear covers it.

Studio: one shared Ajv compiler for metadata packs

Before, every distinct schema created its own Ajv2020 instance. Now one compiler with addUsedSchema: false compiles them all, so an edited schema can reuse its $id.

After each compile, the schema is removed from Ajv's identity cache. Without this, a schema edited in place would return the stale validator (the existing regression test revalida esquemas editados… catches that). It also keeps memory bounded by the existing 128-entry LRU.

Compiling 128 distinct schemas dropped from about 1.4 s to about 60 ms.

Studio: history equality with JSON semantics

snapshotsEqual now treats a property set to undefined the same as a missing one. A patch like { field: undefined } on an object without that field no longer records an undo step that changes nothing. The new test covers both the no-op patch and a real change. This also drops the fast-deep-equal dependency; the lockfile was updated with pnpm 10.11.0.

Cleanup

  • Removed the unused i18n key issue.duplicatedTransitionCondition (en and es).
  • Added [Unreleased] CHANGELOG entries.

Validation

  • go vet ./... and go test -race ./... pass.
  • pnpm lint, typecheck, test (331 + 3 tests), build and audit --audit-level=high pass.

- contextMutex.Unlock panics on an unlocked mutex instead of blocking.
- Metadata pack validation shares one Ajv compiler and evicts each schema
  from Ajv's identity cache, so in-place edits recompile and memory stays
  bounded by the LRU.
- History equality uses JSON semantics (undefined equals absent), so no-op
  patches do not record undo steps; drops the fast-deep-equal dependency.
- Remove the unused issue.duplicatedTransitionCondition message.
@rendis
rendis merged commit 5d363b3 into main Oct 5, 2026
6 checks passed
@rendis
rendis deleted the issue/wonderful-fermi-8r8eid branch October 5, 2026 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant