•  
      request #44459 Automagic removal of reverse links when concurrent edit
    Infos
    #44459
    Manuel Vacelet (vaceletm)
    2025-09-08 14:08
    2025-08-28 16:15
    46162
    Details
    Automagic removal of reverse links when concurrent edit

    Scenario

    • Given

      • 2 artifacts "A" and "B"

      • A is opened in a first tab

      • B is opened is a second tab

    • The user on A add a link (forward) to B and "Submit and stay"

      • This update A to create the link

    • The user on B add a comment and "Submit and stay"

      • B is updated with new comment

      • BUT the link from A to B is removed as well

    Why this is happening ?

    When B is submitted, the historical behavior of Tuleap is to consider that the whole artifact is the reference and override whatever values where already set. Usually, if a value is going to be overridden, there is a notification about the conflict with the values that are going to be modified.

    However, the link from A to B is an update of artifact A (a new changeset on A but no changes on B). Hence Tuleap doesn't warn about the conflict and the value is overridden silently.

    Under the hood, the link update is managed by the REST route that update the artifact links with a PUT semantic. This means that the artifact links are updated with the data that are present on the artifact view. As the reverse link was not present at page load, it's not sent at update so it is removed.

    Identified solutions

    Two solutions were investigated

    1. Align the behavior of "reverse artifact link update" with artifact update: add detection of reverse links updates and warn user via the concurrent update mechanism.

      1. Pro: it's consistent with the rest of artifact update

      2. Cons:

        1. it's complicated to deal with concurrent edition in its current form.

        2. the problem was not existing before the new artifact link view and the previous behavior (no removal of artifact links) is known and expected.

    2. Do a special treatment for the reverse links: persist only changes that were explicitly done by the end user. If a link (reverse or forward) is added or removed, its addition or removal is saved in the appropriate artifact, otherwise, nothing change.

      1. Pro: it brings the previous, known, behavior.

      2. Cons:

        1. it's inconsistent with the rest of artifact update (other fields are overridden)

        2. Inconsistency in behaviors is one of the key UX issue, we should avoid to introduce new ones.

    Proposed change

    Solution 2 is selected despite inconsistency because it's currently blocking a significant number of existing users and we have to rollback deployment of new artifact link view in order to prevent issues.

    The ideally solution would be solution 1 + ability to handle conflict resolution during concurrent update but it's too costly and, nevertheless, we need to find a temporary solution first.

    Examples after fix

    Scenario 1 (the original one)

    • Given

      • 2 artifacts "A" and "B"

      • A is opened in a first tab

      • B is opened in a second tab

    • The user on A add a link (forward) to B and "Submit and stay"

      • This update A to create the link

    • The user on B add a comment and "Submit and stay"

      • B is updated with new comment

      • The link A -> B still exist

    Scenario 2

    • Given

      • 2 artifacts "A" and "B"

      • There is a link A -> B

      • A is opened in a first tab

      • B is opened in a second tab

    • The user on A remove a the link (forward) to B and "Submit and stay"

      • This update A to remove the link

    • The user on B add a comment and "Submit and stay"

      • B is updated with new comment

      • The link doesn't exists (not recreated)

    Scenario 3

    • Given

      • 2 artifacts "A" and "B"

      • A is opened in a first tab: TAB1

      • A is also opened in a second tab: TAB2

    • On TAB1, a forward link A -> B is added and "Submit and stay"

      • This update A to create the link

    • On TAB2, add a comment and "Submit and stay"

      • A is updated with a new comment

      • The link A -> B still exist

    Scenario 4

    • Given

      • 2 artifacts "A" and "B"

      • There is a link A -> B

      • A is opened in a first tab: TAB1

      • A is also opened in a second tab: TAB2

    • On TAB1, the A -> B link is deleted and "Submit and stay"

      • This update A to remove the link

    • On TAB2, add a comment and "Submit and stay"

      • A is updated with a new comment

      • The link doesn't exists (not recreated)

    Empty
    Empty
    Empty
    • [ ] enhancement
    • [ ] internal improvement
    Empty
    Stage
    Empty
    New
    Empty
    Attachments
    Empty
    References
    Referencing request #44459

    Follow-ups

    User avatar

    Duplicate of #44453 ?


    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes
    User avatar
    • Original Submission
      Something went wrong, the follow up content couldn't be loaded
      Only formatting have been changed, you should switch to markup to see the changes