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

Expose underlying storage session #6529

Closed

Conversation

lailabougria
Copy link
Contributor

Alternative to #6526

Although this does in theory break SemVer, it's a very low degree of impact.

…specific session)

Co-authored-by: Daniel Marbach <daniel.marbach@particular.net>
@@ -102,7 +102,7 @@ public static IIncomingLogicalMessageContext CreateIncomingLogicalMessageContext
/// <summary>
/// Creates a <see cref="IInvokeHandlerContext" /> based on the current context.
/// </summary>
public static IInvokeHandlerContext CreateInvokeHandlerContext(this StageConnector<IIncomingLogicalMessageContext, IInvokeHandlerContext> stageConnector, MessageHandler messageHandler, CompletableSynchronizedStorageSession storageSession, IIncomingLogicalMessageContext sourceContext)
public static IInvokeHandlerContext CreateInvokeHandlerContext(this StageConnector<IIncomingLogicalMessageContext, IInvokeHandlerContext> stageConnector, MessageHandler messageHandler, SynchronizedStorageSession storageSession, IIncomingLogicalMessageContext sourceContext)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if we align on this change, we definitely should.

@timbussmann
Copy link
Contributor

I'm not really sure I understand how this addresses/replaces #6526, can you elaborate?

@lailabougria
Copy link
Contributor Author

Well, the weirdness was based on the fact that you have:

public static CompletableSynchronizedStorageSession GetAdaptedSession(this CompletableSynchronizedStorageSession session) =>
            ((CompletableSynchronizedStorageSessionAdapter)session).AdaptedSession;

which is basically a method accepting a CompletableSynchronizedStorageSession which again returns a CompletableSynchronizedStorageSession, which looks off. I do agree that it looks off because the API doesn't convey that it's being unwrapped. However, if we change the signature, that's not true anymore, and it better conveys that it's being unwrapped.
This PR does address that.

Or do you have other concerns?

@danielmarbach
Copy link
Contributor

For me this would be the perfect middle ground between exposing the adapter as suggested in the other PR and leaving status quo. The only thing that makes me a bit hesitant is that we would have to change the extension method on v8 too (which has already shipped as RC2, that being said I'd be happy to go this way)

@timbussmann
Copy link
Contributor

which is basically a method accepting a CompletableSynchronizedStorageSession which again returns a CompletableSynchronizedStorageSession, which looks off. I do agree that it looks off because the API doesn't convey that it's being unwrapped. However, if we change the signature, that's not true anymore, and it better conveys that it's being unwrapped.
This PR does address that.

I don't think this really addresses the issue: CompletableSynchronizedStorageSession implements SynchronizedStorageSession, so essentially you can still pass the same instance of CompletableSynchronizedStorageSession to every method that takes a SynchronizedStorageSession as parameter. It doesn't eliminate the risk and in that case I'd prefer to leave as-is and just accept that risk or completely resolve it (as suggested by making the adapter public) instead of a middle ground that doesn't help with the problem.

@danielmarbach
Copy link
Contributor

Closing in favour of #6526

@danielmarbach danielmarbach deleted the adapter-alternative branch September 6, 2022 09:57
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.

4 participants