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

WIP: Integrate conflict resolution with publish/discard dialog workflow #3769

Draft
wants to merge 7 commits into
base: feature/conflict-resolution-02/rebase-conflicts
Choose a base branch
from

Conversation

grebaldi
Copy link
Contributor

@grebaldi grebaldi commented Apr 22, 2024

solves: #3761
builds on: #3762

Description

Steps to reproduce

Assuming you have two user accounts with Neos.Neos:Editor role (let's call them "editor-a" and "editor-b"):

  1. Log in as "editor-a"
  2. Create a document "Test"
  3. Add a text node to "Test"
  4. Publish those changes
  5. Edit the text node, without publishing that change
  6. Log in as "editor-b" in a private window (keep "editor-a"'s window open!)
  7. Sync "editor-b"'s workspace, so you can see document "Test"
  8. Remove document "Test"
  9. Publish that change
  10. Switch to "editor-a"'s window (do not reload the page!)
  11. Try to publish the change on the text node that is still pending
  12. Observe:
  • Pre-PR: Publishing results in an exception
  • Post-PR: Publishing triggers conflict resolution

Remaining TODOs

  • Move Conflicts concept to Application\Shared namespace
    • Move ConflictsOccurred to Application\Shared namespace
    • Move Conflict to Application\Shared namespace
    • Move Conflicts to Application\Shared namespace
    • Move ConflictsBuilder to Application\Shared namespace
    • Move ReasonForConflict to Application\Shared namespace
    • Move TypeOfChange to Application\Shared namespace
    • Move IconLabel to Application\Shared namespace
  • Add command handlers for all Publish-related commands & make sure they throw ConflictsOccurred
    • Move PublishChangesInDocument -> PublishChangesInDocument\PublishChangesInDocumentCommand
    • Create PublishChangesInDocumentCommandHandler
    • Ensure that PublishChangesInDocumentCommandHandler throws ConflictsOccurred
    • Move PublishChangesInSite -> PublishChangesInSite\PublishChangesInSiteCommand
    • Create PublishChangesInSiteCommandHandler
    • Ensure that PublishChangesInSiteCommandHandler throws ConflictsOccurred
  • Turn ConflictsOccurred into a Result DTO rather than an exception
  • Eliminate redundancy in catch (WorkspaceRebaseFailed $e) clauses
  • Trigger conflict resolution from within Publish saga
    • Add conflicts case to PublishingResponse
    • Add PublishingState.CONFLICTS
  • Fix: "Node could not be published, because of missing parentNode" after conflict resolution (happens when you do "Publish Document" on a document that gets removed by conflict resolution)

@grebaldi grebaldi force-pushed the feature/conflict-resolution-02/rebase-conflicts branch from 2b55b57 to 3069277 Compare April 22, 2024 15:25
@grebaldi grebaldi force-pushed the feature/conflict-resolution-03/rebase-during-publish branch from 5ae58ec to 8e4a03d Compare April 22, 2024 15:26
@grebaldi grebaldi linked an issue Apr 23, 2024 that may be closed by this pull request
6 tasks
@grebaldi grebaldi force-pushed the feature/conflict-resolution-02/rebase-conflicts branch from 3069277 to f3ac501 Compare April 25, 2024 15:13
@grebaldi grebaldi force-pushed the feature/conflict-resolution-03/rebase-during-publish branch from a3768ea to 926004b Compare April 25, 2024 15:16
This moves the classes `ConflictsOccurred`, `Conflict`, `Conflicts`,
`ConflictsBuilder`, `ReasonForConflict`, `TypeOfChange` and `IconLabel`
into the `Application\Shared` namespace and adjusts all references
accordingly.

These classes are going to be reused by multiple command handlers.
This includes the following tasks;
- Move `PublishChangesInDocument` ->
`PublishChangesInDocument\PublishChangesInDocumentCommand`
- Create `PublishChangesInDocumentCommandHandler`
- Move `PublishChangesInSite` ->
`PublishChangesInSite\PublishChangesInSiteCommand`
- Create `PublishChangesInSiteCommandHandler`
@grebaldi grebaldi force-pushed the feature/conflict-resolution-03/rebase-during-publish branch from 926004b to 1d493ed Compare April 29, 2024 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FEATURE: Offer rebase option when publish/discard fails due to conflict
1 participant