Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolveConflict() api #3073

Merged
merged 4 commits into from
Aug 26, 2024
Merged

Conversation

samuelstroschein
Copy link
Member

@samuelstroschein samuelstroschein commented Aug 26, 2024

Context

This PR introduces the possibility for apps to resolve conflicts. Closes opral/lix-sdk#49

A conflict is resolved by providing a change, which does not necessarily create a new change. If the change does not exist in the database (a resolution via merging two changes that result in a new change, for example), the function inserts the change.

await resolveConflict({
  lix, 
  conflict: conflict,
  resolveWithChange: changes[0],
});

Copy link

changeset-bot bot commented Aug 26, 2024

⚠️ No Changeset found

Latest commit: e91493d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -65,6 +65,7 @@ export async function newLixFile(): Promise<Blob> {
conflicting_change_id TEXT NOT NULL,
reason TEXT,
meta TEXT,
resolved_with_change_id TEXT,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Used as marker if a conflict has been resolved.

@samuelstroschein
Copy link
Member Author

@janfjohannes if you approve the PR, merge it to unblock @NiklasBuchfink and @NilsJacobsen while I am asleep

Copy link
Contributor

@janfjohannes janfjohannes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samuelstroschein approved so you can proceed as you want, but i have a few comments that would probably be better improved if there is time...

Using lodash intead of `fast-deep-equal` because fast deep equal crashed.
@samuelstroschein samuelstroschein merged commit 1f22ef8 into lix-integration Aug 26, 2024
2 checks passed
@samuelstroschein samuelstroschein deleted the samuel/conflict-resolution branch August 26, 2024 19:28
@github-actions github-actions bot locked and limited conversation to collaborators Aug 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants