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

Rebase creates conflict if both "our" and "their" changeset do the same change #152

Closed
wonder-sk opened this issue Oct 15, 2021 · 0 comments · Fixed by #156
Closed

Rebase creates conflict if both "our" and "their" changeset do the same change #152

wonder-sk opened this issue Oct 15, 2021 · 0 comments · Fixed by #156
Labels
bug Something isn't working

Comments

@wonder-sk
Copy link
Contributor

wonder-sk commented Oct 15, 2021

As the title says - if two users do an update of a feature independently, but the actual change is the same (e.g. both change an attribute value of the same feature from 40 to 42), geodiff will generate a rebase conflict file. Ideally this should not happen, because there wasn't really any conflict, so we should detect such cases and skip reporting conflicts, because that's confusing to users if they see conflict files appearing.

Try to run this command using test data from geodiff:

$ geodiff rebase-diff tests/testdata/base.gpkg \
    tests/testdata/1_geopackage/base-modified_1_geom.diff \
    tests/testdata/1_geopackage/base-modified_1_geom.diff \
    /tmp/x_rebased.diff /tmp/x_conflict.json

In short, we are trying to rebase a diff on top of the same diff, so there should be no conflict and the rebased diff should be empty. But instead we are getting a conflict file:

{
   "geodiff": [
      {
        "table": "gpkg_contents",
        "type": "conflict",
        "fid": "334167370",
        "changes": [
          {
              "column": 5,
              "base": -1.0889200000000001,
              "old": -0.73050599999999999,
              "new": -0.73050599999999999
          }
        ]
      },
      {
        "table": "simple",
        "type": "conflict",
        "fid": "1",
        "changes": [
          {
              "column": 1,
              "base": "R1AAAeYQAAABAQAAAB54y6E2bPG/cOaqyDmB3T8=",
              "old": "R1AAAeYQAAABAQAAAClvCOFAFeG/lhl3A7Qi0z8=",
              "new": "R1AAAeYQAAABAQAAAClvCOFAFeG/lhl3A7Qi0z8="
          }
        ]
      }
   ]
}

(the gpkg_contents changes should have been ignored when reading the source diff, that's probably another minor issue to handle)

And the rebased diff looks like this instead of being empty:

{
   "geodiff": [
      {
        "table": "gpkg_contents",
        "type": "update",
        "changes": [
          {
              "column": 0,
              "old": "simple"
          },
          {
              "column": 4,
              "old": "2019-06-26T08:19:00.735Z",
              "new": "2019-06-26T08:19:00.735Z"
          },
          {
              "column": 5,
              "old": -0.73050599999999999,
              "new": -0.73050599999999999
          }
        ]
      },
      {
        "table": "simple",
        "type": "update",
        "changes": [
          {
              "column": 0,
              "old": 1
          },
          {
              "column": 1,
              "old": "R1AAAeYQAAABAQAAAClvCOFAFeG/lhl3A7Qi0z8=",
              "new": "R1AAAeYQAAABAQAAAClvCOFAFeG/lhl3A7Qi0z8="
          }
        ]
      }
   ]
}
@wonder-sk wonder-sk added the bug Something isn't working label Oct 15, 2021
wonder-sk added a commit that referenced this issue Nov 10, 2021
When the final value (of a given row in a given column) would end up
the same after two concurrent edits, geodiff would still produce conflicts,
confusing users why would they appear. This commit adds handling of that
case.
wonder-sk added a commit that referenced this issue Nov 10, 2021
When the final value (of a given row in a given column) would end up
the same after two concurrent edits, geodiff would still produce conflicts,
confusing users why would they appear. This commit adds handling of that
case.
tomasMizera pushed a commit that referenced this issue Nov 12, 2021
When the final value (of a given row in a given column) would end up
the same after two concurrent edits, geodiff would still produce conflicts,
confusing users why would they appear. This commit adds handling of that
case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant