Closed
Conversation
- Replace Promise.all() with Promise.allSettled() in batch processing to handle individual entity failures gracefully - Add failedEntities counter to SyncStats to track entities that couldn't be processed - Continue syncing even when individual entities have invalid data (e.g., malformed Unix timestamps) - Log warnings for failed entities while continuing to process valid ones - Fix test suite for incremental sync functionality after merge from dev branch - Clean up temporary test files and remove sensitive data
- Fix invalid entity ID formats in tests (use proper UUIDs instead of 'entity-0', 'folder-1') - Add complete mock data tags for GQL nodes (Parent-Folder-Id, ArFS, Unix-Time, Content-Type) - Stub batch processing methods in tests to return valid mock entities - Update beforeEach hooks to async for proper mock entity creation - Maintain Promise.allSettled error handling for production resilience All 14 incremental sync tests now passing. TypeScript and ESLint checks clean.
- Fixed invalid entity ID generation in tests (proper UUID format) - Added all required tags to mock GraphQL nodes (App-Name, App-Version, Content-Type) - Stubbed getTxData method to return mock metadata for builders - Removed unused imports and fixed linting issues - Fixed transaction ID format to be exactly 43 characters - Improved error handling with Promise.allSettled retained for robustness
- Added App-Name, App-Version, and Content-Type tags to all mock nodes - Fixed entity ID generation to use proper padding (4 digits) - Updated mock nodes in both public and private sync tests - Stubbed getTxData to return mock metadata for entity builders - Separated folder and file query responses to prevent infinite loops - Fixed all private sync test mock data to include required tags
Implements storage adapter pattern to persist sync state across application sessions, enabling efficient incremental synchronization after restarts. Storage Adapters: - Add SyncStateStore interface defining storage contract - Implement MemorySyncStateStore for in-memory caching (with tests) - Implement FileSystemSyncStateStore for Node.js persistence - Implement LocalStorageSyncStateStore for browser localStorage - Implement IndexedDBSyncStateStore for browser IndexedDB - Add SQLiteSyncStateStore as optional adapter (requires better-sqlite3) Integration: - Integrate storage adapters with ArFSDAOIncrementalSync and ArFSDAOAnonymousIncrementalSync - Add setCachedSyncState/getCachedSyncState methods with storage fallback - Storage persists alongside in-memory cache for redundancy Documentation: - Add comprehensive README section on persistent storage - Include working example in examples/persistent-sync-example.js - Document all storage management methods (save, load, clear, list, clearAll) - Clear guidance on ArFSDAOIncrementalSync usage with storage adapters Testing: - Add tests for MemorySyncStateStore covering core interface - Basic validation that exports work correctly BREAKING CHANGE: None - storage adapters are optional and backward compatible Note: SQLite adapter provided as optional file to avoid forcing peer dependency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.