Skip to content

Distributed Transaction Integrity & Vector-Clock Reconciler #730

@SatyamPandey-07

Description

@SatyamPandey-07

Objective: Upgrade the simple sync logic to a "Consensus Reconciler." This system handles conflicts when multiple devices edit the same expense offline using Vector Clocks and a "Conflict Resolution Graveyard" to ensure no data is lost during merges.

Files involved (11):

models/SyncConflict.js
(New: Stores raw conflicting state objects)
services/consensusEngine.js (New: The merge logic using Vector Clocks)
utils/vectorClockUtils.js (New: Math for version comparisons)

middleware/syncInterceptor.js
(New: Headers for version tracking)

routes/sync.js
(Update: Bulk resolution endpoints)

services/transactionService.js
(Update: Implementing "Soft Merge" logic)

models/Transaction.js
(Update: Adding version maps)
jobs/conflictPruner.js (New: Cleans up resolved conflicts)
utils/hashGenerator.js (New: Checksumming for data integrity)
tests/consensusEngine.test.js (New: Conflict scenario tests)
CONSENSUS_ARCH.md (Technical spec)

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions