This document tracks known issues, bugs, and areas needing improvement in the proxy-live-document library.
- ✅ Fixed - Issue has been resolved
- 🔴 Bug - Confirmed bug that needs fixing
⚠️ Limitation - Known limitation or edge case- 📝 Won't Fix - Intentional decision not to fix
Status: Won't Fix (Can be removed)
Location: src/index.ts:1195
Issue: The reshape() method on selectors throws an error "reshape is no longer supported"
Test: tests/basic-select.test.ts:209 (currently skipped with it.skip)
Decision: This functionality is not necessary. Applications can achieve the same result by:
- Calling
dispose()on the existing selector - Creating a new selector with updated paths
- Binding the same callback
Recommended Action:
- Remove the skipped test entirely
- Update documentation to clarify that selectors are immutable once created
- Consider removing the
reshapemethod from the API entirely in a future breaking change
Status: Bug (Needs Fix)
Location: Array proxy handler for splice() method
Issue: When splice() is called with both remove and add operations (e.g., array.splice(1, 1, 'new', 'items')), the generated patches only include the removal operation, not the additions.
Test: tests/array/splice-replace.test.ts:48 (newly created, failing)
Example:
const state = { words: ['hello', 'world', '!'] }
mutate(state, (modifiable) => {
modifiable.words.splice(1, 1, 'beautiful', 'day')
})
// Result: ['hello', 'beautiful', 'day', '!']
// Patches generated: Only shows removal of 'world', missing additionsImpact:
- Patches cannot be replayed correctly with
mutateFromPatches() - State synchronization across clients would be incorrect
- Undo/redo functionality would be broken
Root Cause: The array proxy handler likely only handles the removal part of splice, not the insertion part
Recommended Action:
- Investigate
ProxyMutationArrayHandlerinsrc/index.ts - Ensure
splice()generates patches for both removes AND adds - Test with various splice scenarios (remove only, add only, remove+add)
Status: Incomplete Implementation
Methods Tested and Working:
- ✅
push()- Generates correct patches - ✅
pop()- Generates correct patches - ✅
shift()- Generates correct patches - ✅
unshift()- Generates correct patches - ✅ Direct index assignment (
arr[0] = value) - Works - ✅ Array replacement (
state.arr = newArray) - Works ⚠️ delete arr[index]- Works but replaces withundefined(array doesn't shrink)
Methods Potentially Problematic (Not yet tested):
- ❓
splice()with remove+add - CONFIRMED BUG (see issue #2) - ❓
reverse()- Created test, needs verification - ❓
sort()- Created test, needs verification - ❓
fill()- Not tested - ❓
copyWithin()- Not tested
Test Coverage: tests/array/basic.test.ts and tests/array/splice-replace.test.ts
Recommended Action:
- Run the new
splice-replace.test.tstests forreverse()andsort() - Create comprehensive test suite for all array mutating methods
- Document which array methods are supported vs unsupported
- Consider warning users about unsupported methods in documentation
Location: tests/mutate-patch-order.test.ts:26
Issue: Had describe.only() which was masking other test failures
Status: Fixed - changed to describe()
Issue: Many tests use observe() which outputs deprecation warnings
Locations: Throughout test suite
Warning: "observe is depreacated. Use just selectors or autorun instead"
Recommended Action:
- Audit all tests using
observe() - Migrate to recommended APIs
- Consider removing
observe()in a breaking version
Status: Known Limitation (Documented in tests)
Location: tests/array/basic.test.ts:220-257
Issue: Using delete on an array element replaces it with undefined but doesn't shrink the array
Comment from code:
// BEWARE. Remove here replaces with undefined actually. For arrays it is
// very different! The array DOES NOT SHRINK! My intution would be that it
// should be a replace with undefined not a remove, but it would require
// implementing a different mutation logic for arrays.Current Behavior:
- Generates a
removeoperation patch - Array maintains same length but has
undefinedat deleted index
Expected Behavior (arguably):
- Should generate a
replacewithundefinedpatch - Or implement proper array shrinking
Recommended Action:
- Document this limitation clearly in README
- Recommend using
splice()instead ofdeletefor arrays - Consider if this behavior should be changed in a major version
Status: Non-critical (Development dependencies)
Issue: npm audit reports 15 vulnerabilities (1 low, 6 moderate, 7 high, 1 critical)
Impact: Development dependencies only, doesn't affect production builds
Recommended Action:
- Review
npm auditoutput - Update dependencies where possible
- Document any dependencies that can't be updated safely
- Array
splice()with remove+add - Breaks patch replay
- Test and document all array method support
- Remove or document reshape functionality
- Migrate away from deprecated
observe()API
- Array
deleteoperator behavior documentation - Dependency updates
- Remove test artifacts (
describe.only, skipped tests)
Last run: 2025-11-01
Before cleanup:
- Test Files: 2 failed | 21 passed (23)
- Tests: 2 failed | 121 passed (123)
- Failing: reshape test, splice-replace test
Action Items:
- Remove or unskip reshape test per decision
- Fix array splice bug OR document as unsupported
- Verify
reverse()andsort()test results