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: Ensure users content stream is never left closed after publication #5342

Merged

Commits on Nov 4, 2024

  1. BUGFIX: Ensure all events are published BEFORE catchup

    Otherwise, due to failures in projection or catchup-hooks the process would be immediately interrupted leaving a broken state.
    
    For example a faulty redirect handler hook - that just listens to live events - would be called during publishing.
    That means the remaining part to publish is already commited and we know we still have work to do to fork the new user content stream and apply the remaining.
    But the catchup hook would interrupt immediately when the events were catchup'd live.
    We would be left with a CLOSED user content stream that contains the "same" events that went live during the rebase. Reopening would not help at that point.
    This is why we must ensure that all events are published BEFORE we do the first catchup.
    
    Further implications:
    - running catchup only once should be more performant
    - we cannot refetch the current content stream version for what where previously "subcommans" (`forkContentStream`) but we must pass $expectedVersions around from the outside
    - we should not run constraint checks after the first `yield` as that would still operate on the old state. Thus all checks are combined above
    mhsdesign committed Nov 4, 2024
    Configuration menu
    Copy the full SHA
    90f2b8f View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2024

  1. Merge remote-tracking branch 'origin/9.0' into bugfix/publishing-ensu…

    …re-contentstream-not-closed
    mhsdesign committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    6fc43ab View commit details
    Browse the repository at this point in the history
  2. BUGFIX: Fix reopen content stream if base workspace was written to du…

    …ring publication
    
    ... and a ConcurrencyException is thrown
    
    Introduces a `WorkspacePublicationDuringWritingTest` parallel test (with own cr) to assert that behaviour.
    mhsdesign committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    4352b2e View commit details
    Browse the repository at this point in the history
  3. TASK: Fix parallel tests by ensuring only one is run at time

    That allows us to use the same content repository. Previously a super slow paratest would lead that another testcase will already be started and its setup then run twice at the end.
    
    paratestphp/paratest#905
    mhsdesign committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    18072f6 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    9a6127b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    cb34618 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    0273e32 View commit details
    Browse the repository at this point in the history
  7. TASK: Do not send $commitResult to generator but calculate expected…

    … version instead
    
    Also readd lost documentation and simplifies the `handle`
    
    The ->throw logic was initially introduced via
    
    neos#5315
    
    but then removed again as we thought it was no longer needed.
    mhsdesign committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    77778f9 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    7b922bf View commit details
    Browse the repository at this point in the history
  9. TASK: Wrap rebaseable command extraction into finally block to ensu…

    …re content stream is never left closed
    
    During the beta phase it can happen that user forget to apply a migration to migrate the stored commands in the even metadata, upon publish this would close the content stream and fail directly afterward.
    
    Applying the migration then would not be enough as the content stream is a closed state and has to be repaired manually.
    
    Event thought this is not super likely, its not unlikely as well and the case during publication were we rely on things that might not be that way.
    
    As an alternative we could discuss doing the closing after acquiring the rebaseable commands.
    mhsdesign committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    d27f83f View commit details
    Browse the repository at this point in the history
  10. TASK: Close content stream a bit later instead of having to reopen in…

    … many edge cases
    
    Alternative fix for d27f83f
    
    Previously an error in `extractFromEventStream` because the payload was not correct and yet has to be migrated would lead to a closed content stream which is of course persisted even after fixing the events via migration.
    
    This is still save to do, as the `closeContentStream` will commit the close on the FIRSTly fetched expected version.
    
    Same guarantees, different error behaviour in rare cases.
    mhsdesign committed Nov 9, 2024
    Configuration menu
    Copy the full SHA
    de7895e View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    d290047 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    8e48e7e View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2024

  1. Configuration menu
    Copy the full SHA
    59fa2e3 View commit details
    Browse the repository at this point in the history
  2. TASK: Assert that in WorkspaceWritingDuringRebaseTest that the worksp…

    …ace is still the original content stream
    mhsdesign committed Nov 10, 2024
    Configuration menu
    Copy the full SHA
    48e09cb View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e12c641 View commit details
    Browse the repository at this point in the history

Commits on Nov 12, 2024

  1. Merge remote-tracking branch 'origin/9.0' into bugfix/publishing-ensu…

    …re-contentstream-not-closed
    mhsdesign committed Nov 12, 2024
    Configuration menu
    Copy the full SHA
    b857367 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f883e65 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    dfd4573 View commit details
    Browse the repository at this point in the history