Skip to content

Conversation

@borgez
Copy link

@borgez borgez commented Mar 2, 2024

No description provided.

@borgez
Copy link
Author

borgez commented Mar 2, 2024

#3004

@borgez
Copy link
Author

borgez commented Mar 27, 2024

@jeremydmiller everything is ok? maybe set plan to merge?

@jeremydmiller
Copy link
Member

@borgez It's a breaking change in behavior. I can't take this in. What was the purpose of this? Why did you need this?

@borgez
Copy link
Author

borgez commented Apr 2, 2024

@jeremydmiller

I want to add general data like uid, etc... to the event, and expected behavior: projections handle this changes in "inline" mode.

The current behavior doesn't seem quite as expected because the changes are applied to projections before the hook.
Maybe then add another hook for this case like BeforeApplyChanges, but it doesn't seem very good?

The test describes my case:

      public override void BeforeSaveChanges(IDocumentSession session)
      {
          var streams = session.PendingChanges.Streams();
          foreach (var stream in streams)
          {
              foreach (var e in stream.Events)
              {
                  if (e.Data is EnrichedUserEvent eueb)
                  {
                      eueb.Actor = "some user from identity";
                  }
              }
          }
      }

@jeremydmiller
Copy link
Member

@borgez We can revisit this, but you'll have to add something new or custom. We can't change the BeforeSaveChanges() before a potential Marten 8 release.

@borgez
Copy link
Author

borgez commented May 20, 2024

@jeremydmiller maybe add hook BeforeEventProcessing or BeforeEventApply?

@borgez borgez force-pushed the Move-BeforeSaveChanges-BeforeProcessEvents branch from 2304ac4 to 32ff2fa Compare May 29, 2024 14:26
@borgez
Copy link
Author

borgez commented May 29, 2024

@jeremydmiller revorked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants