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

fix: Removes flag resolving from Confidence child instances #149

Merged
merged 1 commit into from
Jul 2, 2024

Conversation

fabriziodemaria
Copy link
Member

The plan is to enable this back once we have support for it in the caching layer.

@@ -3,7 +3,7 @@ import Foundation
/**
Sends events to Confidence. Contextual data is appended to each event
*/
public protocol ConfidenceEventSender: Contextual {
public protocol ConfidenceEventSender: ConfidenceContextProvider {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would removing Contextual not be a breaking change? I am not sure whether it's necessary to remove 🤔

Copy link
Member Author

@fabriziodemaria fabriziodemaria Jul 1, 2024

Choose a reason for hiding this comment

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

Answering here for @vahidlazio as well: the problem I found with Contextual is that withContext returns a Self, and if it's Confidence implementing such protocol the return type can only be Confidence (while we want ConfidenceEventSender instead)

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think that removing Contextual is a breaking change, since final users never operate with such type directly: they either have a Confidence instance or a ConfidenceEventSender instance

Copy link
Contributor

Choose a reason for hiding this comment

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

I think my issue with this is that removing Contextual then means this structure doesn't align with Android/JS anymore.
Right, so since Confidence doesn't confirm to EventSender, it won't be able to return one when calling withContext. I think that makes sense 👍 We should document this somewhere, but that's not necessarily part of this PR

Copy link
Member Author

Choose a reason for hiding this comment

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

I think my issue with this is that removing Contextual then means this structure doesn't align with Android/JS anymore.

True, I am also not very about that. But as long as this is internals, it's less of a problem and we can always change it without breaking backwards compat with final users

Right, so since Confidence doesn't confirm to EventSender, it won't be able to return one when calling withContext.

Even if it would conform to EventSender, it seems like the return type Self only accepts the type of the implementing class Confidence

@fabriziodemaria fabriziodemaria merged commit 543c380 into main Jul 2, 2024
3 checks passed
@fabriziodemaria fabriziodemaria deleted the with-ctx-disable-resolve branch July 2, 2024 13:30
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.

None yet

3 participants