Skip to content

Commit

Permalink
BUGFIX: Avoid rebasing workspace after discard all solution during co…
Browse files Browse the repository at this point in the history
…nflict resolution

Otherwise, the now up-to-date workspace is synced leading to a no-op exception:

> Skipped rebase workspace "admin-admington" because it is not outdated.
  • Loading branch information
mhsdesign committed Jan 22, 2025
1 parent 5e9e318 commit ff938de
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
2 changes: 0 additions & 2 deletions Tests/IntegrationTests/Fixtures/1Dimension/syncing.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ test('Syncing: Create a conflict state between two editors and choose "Discard a
await prepareContentElementConflictBetweenAdminAndEditor(t);
await chooseDiscardAllAsResolutionStrategy(t);
await confirmAndPerformDiscardAll(t);
await finishSynchronization(t);

await assertThatWeAreOnPage(t, 'Home');
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #1');
Expand Down Expand Up @@ -62,7 +61,6 @@ test('Syncing: Create a conflict state between two editors and choose "Drop conf
await cancelDropConflictingChanges(t);
await chooseDiscardAllAsResolutionStrategy(t);
await confirmAndPerformDiscardAll(t);
await finishSynchronization(t);

await assertThatWeAreOnPage(t, 'Home');
await assertThatWeCannotSeePageInTree(t, 'Sync Demo #1');
Expand Down
14 changes: 4 additions & 10 deletions packages/neos-ui-sagas/src/Sync/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const makeSyncPersonalWorkspace = (deps: {
export const makeResolveConflicts = (deps: {
syncPersonalWorkspace: ReturnType<typeof makeSyncPersonalWorkspace>
}) => {
const discardAll = makeDiscardAll(deps);
const discardAll = makeDiscardAll();

function * resolveConflicts(conflicts: Conflict[]): any {
while (true) {
Expand Down Expand Up @@ -155,16 +155,14 @@ function * waitForRetry() {
return Boolean(retried);
}

const makeDiscardAll = (deps: {
syncPersonalWorkspace: ReturnType<typeof makeSyncPersonalWorkspace>;
}) => {
const makeDiscardAll = () => {
function * discardAll() {
yield put(actions.CR.Publishing.start(
PublishingMode.DISCARD,
PublishingScope.ALL
));

const {cancelled, failed}: {
const {cancelled}: {
cancelled: null | ReturnType<typeof actions.CR.Publishing.cancel>;
failed: null | ReturnType<typeof actions.CR.Publishing.fail>;
finished: null | ReturnType<typeof actions.CR.Publishing.finish>;
Expand All @@ -176,12 +174,8 @@ const makeDiscardAll = (deps: {

if (cancelled) {
yield put(actions.CR.Syncing.cancelResolution());
} else if (failed) {
yield put(actions.CR.Syncing.finish());
} else {
yield put(actions.CR.Syncing.confirmResolution());
yield * deps.syncPersonalWorkspace(false);
}
yield put(actions.CR.Syncing.finish());
}

return discardAll;
Expand Down

0 comments on commit ff938de

Please sign in to comment.