Current Version Used by live-mutex: 0.1.106
Latest Version Available: 2.1.129
Status:
✅ All 12 tests passed for current version (0.1.106)
All methods used in live-mutex broker code are present and working:
- ✅
constructor()- Works - ✅
length(property) - Works - ✅
push(key, value)- Present and working - ✅
unshift(key, value)- Present and working - ✅
remove(key)- Works - ✅
dequeue()- Works - ✅
get(key)- Works - ✅
contains(key)- Works - ✅
deq(n)- Works - ✅
getLength()- Works
The latest version (2.1.129) does NOT have these methods that live-mutex uses:
- ❌
push()- MISSING (useenqueue()instead) - ❌
unshift()- MISSING (useaddToFront()instead) - ❌
pop()- MISSING - ❌
shift()- MISSING - ❌
clear()- MISSING (useremoveAll()instead)
The latest version has these equivalent methods:
enqueue(key, value)- Equivalent topush(key, value)addToFront(key, value)- Equivalent tounshift(key, value)removeLast()- Similar topop()but returns[K, V] | [IsVoidVal]dequeue()- Similar toshift()but returns[K, V] | [IsVoidVal]removeAll()- Equivalent toclear()
If upgrading from 0.1.106 to 2.1.129, the following changes are required in live-mutex:
- src/broker.ts
- src/broker-1.ts
- src/broker-old.ts
Before:
lck.notify.push(uuid, {ws, uuid, pid, ttl, keepLocksAfterDeath});After:
lck.notify.enqueue(uuid, {ws, uuid, pid, ttl, keepLocksAfterDeath});Locations:
src/broker.ts: Lines 1120, 1217, 1379src/broker-1.ts: Lines 1116, 1340
Before:
lck.notify.unshift(uuid, {ws, uuid, pid, ttl, keepLocksAfterDeath});After:
lck.notify.addToFront(uuid, {ws, uuid, pid, ttl, keepLocksAfterDeath});Locations:
src/broker.ts: Lines 1366, 1376src/broker-1.ts: Lines 1327, 1337
The latest version may have different return types for some methods:
dequeue()returns[K, V] | [typeof IsVoidVal]instead ofLinkedQueueValue<T>- Need to check
IsVoidutility:LinkedQueue.IsVoid(value[0])
✅ Pros:
- No code changes required
- All tests passing
- Stable and working
❌ Cons:
- Missing latest features/bug fixes
- May have security vulnerabilities (check npm audit)
✅ Pros:
- Latest features and bug fixes
- Better TypeScript support
- More modern codebase
❌ Cons:
- Requires code changes in 3 broker files
- Need to test thoroughly
- Return type changes may require additional updates
If the maintainer is open to it, request adding push() and unshift() as aliases to maintain backward compatibility.
- Update all
push()calls toenqueue() - Update all
unshift()calls toaddToFront() - Test
dequeue()return type handling - Test
deq()return type handling - Run all live-mutex tests
- Test semaphore functionality
- Test lock/unlock operations
- Test concurrent access patterns
src/broker.ts- ~5 changessrc/broker-1.ts- ~4 changessrc/broker-old.ts- Check if still used
The current version (0.1.106) is working correctly and all tests pass. The latest version (2.1.129) has breaking changes that require code modifications.
Recommendation: Stay on 0.1.106 unless there are specific features or bug fixes in 2.1.129 that are needed. If upgrading, follow the migration path above and test thoroughly.