Fix Story 1.3: StateStore spec compliance and minor cleanup

Critical Fix:
- StateStore now uses global Hooks.callAll directly (per spec)
- Removed hooks parameter from StateStore constructor
- Updated module.js to pass only adapter.settings
- Updated tests to stub globalThis.Hooks

Minor Cleanup:
- Fixed misleading warning in SocketHandler.registerPendingOp
- Added clarifying comment for setMatrix _revision behavior

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
2026-05-22 11:38:45 +02:00
parent 110b295a7b
commit 5ba7717ecd
17 changed files with 2391 additions and 55 deletions
+11 -3
View File
@@ -1,7 +1,15 @@
/**
* Generates a unique operation ID for PendingOp tracking.
* @returns {string} A unique identifier string.
* @module utils/uuid
* Unique operation ID generation for PendingOp tracking.
*/
/**
* Generates a unique operation ID.
* Uses crypto.randomUUID() when available; falls back to a time-random composite.
* @returns {string}
*/
export function generateOpId() {
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
return typeof crypto !== 'undefined' && typeof crypto.randomUUID === 'function'
? crypto.randomUUID()
: `op-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 9)}`;
}