-
-
Notifications
You must be signed in to change notification settings - Fork 135
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
!!!FEATURE: Offer resolution strategies when conflicts arise during rebase #3762
!!!FEATURE: Offer resolution strategies when conflicts arise during rebase #3762
Conversation
7f50bb0
to
25e88e0
Compare
6a0910d
to
8d44c6d
Compare
25e88e0
to
f471b6b
Compare
d79c71d
to
5c51d02
Compare
5a8a92c
to
6645c4d
Compare
bf53841
to
b5b9068
Compare
8567211
to
2b55b57
Compare
bec21c1
to
455ff67
Compare
2b55b57
to
3069277
Compare
…ault to UP_TO_DATE
This includes a new data-point `totalNumberOfChanges` which gives us the number of all changes in the workspace (as opposed to just the changes per-site or per-document). This is needed to inform the `DISCARD_ALL` strategy during rebase.
…flicting changes" strategy
Namely: Neos.Neos.Ui:Main:workspaceSynchronizationApplied Neos.Neos.Ui:Main:syncPersonalWorkSpaceConfirm Neos.Neos.Ui:Main:syncPersonalWorkSpaceMessage Neos.Neos.Ui:Main:syncPersonalWorkSpaceMessageOutdated Neos.Neos.Ui:Main:syncPersonalWorkSpaceMessageOutdatedConflict
3069277
to
f3ac501
Compare
I lack the energy and brain to fully review this tonight. But I want to say that this is the best PR that I have ever seen.. Feature wise, but especially its description with screenshots and collapsed videos and all that swag <3 |
Ohh wow, this looks really great! Thank you @grebaldi! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one little thing, the rest looks nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much ❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks splendid <3 Thank you so much!
The new e2e tests are sadly a bit flaky in ci :O |
solves: #3744
builds on: #3759
Description
When editors work in parallel, it may happen that one editor publishes changes that create conflicts with the changes of another editor. Since #3665 it has been possible for users update their workspace whenever it has fallen out-of-sync with its respective base workspace. Up until now, this mechanism doesn't handle conflicts. When a rebase operation fails due to conflicts, users are trapped in a workspace that cannot be synced, published nor discarded. The only way out is the CLI (see: neos/neos-development-collection#4939).
TLDR; This PR introduces a dialog workflow that allows users to select a resolution strategy for dealing with conflicts that arise during the synchronization of their user workspace.
How to provoke a conflict
Assuming you have two user accounts with
Neos.Neos:Editor
role (let's call them "editor-a" and "editor-b"):Conflict-Free Synchronization Workflow
Show video
Peek.2024-04-26.16-36.Sync.Workflow.mp4
When the user clicks on the orange "Sync" button, a dialog opens that asks them to confirm their intended action. Once they click "Yes, synchronize now", a process indicator opens that cannot be closed. During the operation a
beforeunload
handler prevents the user from leaving the page. After the operation has finished, the user is presented with a dialog stating the success of the synchronization. Once they click "OK", they see the updated UI state.If synchronization has removed the document that the user was currently looking at, they have been silently redirected to the closest ancestor of that document.
Synchronization with Conflicts (Strategy
FORCE
)Show video
Peek.2024-04-26.16-49.Sync.Workflow.With.Conflicts.Drop.mp4
Again, when the user clicks on the orange "Sync" button, a dialog opens that asks them to confirm their intended action. Once they click "Yes, synchronize now", a process indicator opens that cannot be closed. If the server-side rebase operation fails, the process indicator is interrupted by a dialog that states the presence of conflicts and offers a choice between two strategies to resolve those conflicts:
If they choose "Drop conflicting changes" as a resolution strategy, the user is again presented with a dialog that asks them to confirm their intended action. Once they click "Yes, drop those changes", the synchronization starts once again, this time transmitting
force: true
to the server-side command handler.The rest of the workflow is analogous to the Conflict-Free Synchronization Workflow.
Conflict List
Show screenshot
The conflict list is shown both in the "Resolution Strategy Selection"-dialog and the "Confirm: Drop conflicting changes"-Dialog. Conflicts are calculated from a list of
CommandThatFailedDuringRebase
-model objects, that carry information about the attempted CR-level command and the exception that prevented this command from being applied.The conflict list is a vertical list of
<detail>
-elements with a<summary>
consisting of an annotated node type icon and the label of the affected node. The little orange annotation to the node type icon represents the type of change, which can be one of 4 things:The list of conflicts has been squashed on the server-side, so only one (the very first) change per node aggregate will be displayed.
Conflict Details
Show screenshot
Opening any item in the conflict list will show the user details about that particular conflict. They will once again see what happened to the affected node in their workspace, and then what is the reason that prevents that change from being applied. Additionally, they'll see what document and what site the affected node belongs to (because conflicts don't necessarily pertain to the site the user is currently looking at).
The "reason for conflict" info is a best-effort guess from the exception that had prevented the respective command from being applied. At the moment, the only reason that will be displayed is "[Node] or one of its ancestor nodes has been deleted". It is possible however for this field to remain empty. Over time we can add more scenarios to the server-side handling of conflicts to better describe each situation.
Synchronization with Conflicts (Strategy
DISCARD_ALL
)Show video
Peek.2024-04-26.16-58.Sync.Workflow.With.Conflicts.Discard.mp4
Once again, when the user clicks on the orange "Sync" button, a dialog opens that asks them to confirm their intended action. After they click "Yes, synchronize now", a process indicator opens that cannot be closed. Upon failure of the server-side rebase operation, they are presented with a "Resolution Strategy Selection" dialog.
If they choose "Discard workspace ..." as a resolution strategy, the user is again presented with a dialog that asks them to confirm their intended action. When they click "Yes, discard", their entire workspace will be discarded.
The synchronization process is resumed afterwards.
Error Handling
Errors are handled just like in #3759.
Remaining TODOs
UI.SyncWorkspaceModal
redux state toCR.Syncing
CR.Syncing
statebeforeunload
handler during rebasefocusedValue
of typenumber
supplied toSelectBox_ListPreviewFlat
ConflictList
.{ prefix: "fas", iconName: "questionmark" }
WorkspaceStatus.OUTDATED_CONFLICT
from ts-interfacesstate.ui.remote.isSyncing
Neos.Neos.Ui:Main:workspaceSynchronizationApplied
Neos.Neos.Ui:Main:syncPersonalWorkSpaceConfirm
Neos.Neos.Ui:Main:syncPersonalWorkSpaceMessage
Neos.Neos.Ui:Main:syncPersonalWorkSpaceMessageOutdated
Neos.Neos.Ui:Main:syncPersonalWorkSpaceMessageOutdatedConflict