Skip to content

PE-8386: incremental drive sync#261

Closed
fedellen wants to merge 10 commits intodevfrom
PE-8386-incremental-drive-sync
Closed

PE-8386: incremental drive sync#261
fedellen wants to merge 10 commits intodevfrom
PE-8386-incremental-drive-sync

Conversation

@fedellen
Copy link
Copy Markdown
Contributor

No description provided.

  - 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
@fedellen fedellen closed this Feb 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants