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

When two object are changed by two users rebase does not work as intented. #7764

Open
khanaffan opened this issue Feb 24, 2025 · 0 comments
Open
Labels
bug Something isn't working editing needs triage

Comments

@khanaffan
Copy link
Contributor

khanaffan commented Feb 24, 2025

It seems when placement is changed conflict hander is never called and incoming change replaces local change.

In this case locally deleted element pop back up during rebase.

To Reproduce
Steps to reproduce the behavior:

  1. With no locks. This is not normal and related to branching.
  2. Change location of graphical element on briefcase 1 and push
  3. Delete the element on briefcase 2 and pull merge.
  4. The deleted element will pop back up and it's also removed from the txn after rebasing.
  5. It observes this only happen when placement is changed otherwise it does get deleted.

Here is a test and branch is set that have following test.

 it.only("delete instance (data conflict) ", async () => {
    const b1 = await ctx.openB1(true /* = noLock */);
    const b2 = await ctx.openB2(true /* = noLock */);

    const e1 = await insertPhysicalObject(b1);
    b1.saveChanges();
    await b1.pushChanges({ description: `inserted physical object [id=${e1}]` });
    await b2.pullChanges();

    const eb1 = b1.elements.getElementProps<PhysicalElementProps>(e1);
    eb1.userLabel = "test1";
    eb1.placement = { origin: { x: 1, y: 1, z: 1 }, angles: { yaw: 1, pitch: 1, roll: 1 } };
    b1.elements.updateElement(eb1);
    b1.saveChanges();
    await b1.pushChanges({ description: `update physical object [id=${e1}]` });

    b2.elements.deleteElement(e1);;
    b2.saveChanges();
    await b2.pullChanges();

    const eb2 = b2.elements.tryGetElementProps<PhysicalElementProps>(e1); // should throw
    assert.isUndefined(eb2);

    b1.close();
    b2.close();
  });

Expected behavior
The element should stay deleted.

reported by : @wgoehrig

@khanaffan khanaffan added bug Something isn't working editing needs triage labels Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working editing needs triage
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant