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:
+11
-3
@@ -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)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user