This custom-built component is designed to resolve real-time data conflicts caused by concurrent edits to the same complex data structure by multiple users within an OutSystems application. It provides an automated and user-assisted merge process, similar to the merge behavior in OutSystems Service Studio, but tailored for runtime user data management.
Imagine two users accessing a form with nested and hierarchical data, such as a multi-section project plan or configuration model:
User A loads the structure, makes edits, and saves the changes.
User B, who had previously loaded the same structure, makes different changes without knowledge of User A’s updates.
When User B attempts to save, the component compares the version B is trying to save against the latest server version.
The component automatically merges non-conflicting changes.
For conflicting fields (e.g., both users updated the same field with different values), the component prompts User B to choose which version to keep.
Frontend Execution: The entire merge logic runs on the front-end, which significantly reduces server load and improves responsiveness. This client-side approach ensures faster conflict detection and smoother interaction for the user.
Data Comparison: The component compares two versions of the data (the local user version vs. the latest server version), typically represented as JSON objects or record lists.
Merge Engine: Built using a combination of OutSystems client-side logic and custom JavaScript.
Lodash Integration: The component leverages the Lodash JavaScript library to efficiently traverse, clone, and compare deeply nested data structures. Lodash simplifies complex object operations, making the merge process both reliable and performant.
Conflict Resolution UI: A dynamic interface presents conflicting fields side-by-side, allowing users to resolve differences manually.
Extensibility: Merge rules can be customized to support business-specific logic, such as prioritizing certain fields or applying conditional restrictions.
Version Tracking: Optional integration with audit logs or versioning systems enables historical tracking of changes.
Prevents data loss and overwrites in collaborative editing scenarios.
Improves performance by executing all merge logic client-side.
Minimizes server processing and improves scalability.
Enhances the user experience with real-time feedback and intuitive conflict resolution.
Ensures maintainability and reliability through the use of Lodash for deep data comparison.