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

BUGFIX: Partial publish breaks uri and change Projection #5293

Draft
wants to merge 3 commits into
base: 9.0
Choose a base branch
from

Conversation

kitsunet
Copy link
Member

@kitsunet kitsunet commented Oct 16, 2024

A partial publish results in events annotated for "live" workspace yet are not in the "live" content stream.

This is due to a fork of the live content stream being created with the partially published events in, which is then published to the actual live content stream.
This leaves behind duplicate events both containing "workspaceName: live" yet only one of them is in the live content stream. A catchup or replay will fail however due to duplicate database entries for the projections relying on anything with "workspaceName: live" being actually in the live content stream.

The provided test fails showing the behavior.

Upgrade instructions

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@kitsunet
Copy link
Member Author

WIP DO NOT MERGE, it's just a test showing the behavior.

@mhsdesign mhsdesign marked this pull request as draft October 16, 2024 19:20
@kitsunet
Copy link
Member Author

kitsunet commented Oct 16, 2024

The latest commit fixes the issue at least for new events, but we still need a solution for existing events.

@kitsunet
Copy link
Member Author

The fix is more of a proof-of-concept. I will work on virtual workspaces now and adjust the fix to that once it's done.

@mhsdesign
Copy link
Member

Fyi this was my virtual workspace name draft: #5167

@mhsdesign
Copy link
Member

also this can then be fixed with catchup hooks

// Safeguard for temporary content streams created during partial publish -> We want to skip these events, because their workspace doesn't match current content stream.
try {
$contentGraph = $this->contentRepository->getContentGraph($eventInstance->getWorkspaceName());
} catch (WorkspaceDoesNotExist) {
return;
}
if (!$contentGraph->getContentStreamId()->equals($eventInstance->getContentStreamId())) {
return;
}
}

A partial publish results in events annotated for "live"
workspace yet are not in the "live" content stream.

This is due to a fork of the live content stream being
created with the partially published events in, which is
then published to the actual live content stream.
This leaves behind duplicate events both containing
"workspaceName: live" yet only one of them is in the live
content stream. A catchup or replay will fail however due
to duplicate database entries for the reflections relying
on anything with "workspaceName: live" being actually in
the live content stream.

The provided test fails showing the behavior.
@kitsunet
Copy link
Member Author

I have no clue why these Behat tests are failing, they are fine on my machine and I can't see the relation between the test and what I changed in this.

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.

2 participants