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 for passing TargetingContext when using currentOffering(forPlacement:) #3751

Merged
merged 2 commits into from
Mar 6, 2024

Conversation

joshdholtz
Copy link
Member

Motivation

Targeting context was not being passed when getting current offering for placement

Description

  • Passing Offerings.Targeting when copying Offering with a placement identifier
  • Added test

@joshdholtz joshdholtz added the fix A bug fix label Mar 6, 2024
@joshdholtz joshdholtz requested review from a team March 6, 2024 16:21
@@ -131,7 +131,8 @@ public extension Offerings {
returnOffering = placements.fallbackOfferingId.flatMap { self.all[$0]}
}

return returnOffering?.copyWith(placementIdentifier: placementIdentifier)
return returnOffering?.copyWith(placementIdentifier: placementIdentifier,
targeting: self.targeting)
Copy link
Contributor

Choose a reason for hiding this comment

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

Ohh right... it would be nice if we had something like the copy constructor, that uses the existing values by default unless passed as parameter. We could write it ourselves, but this is ok for now I think.

Copy link
Member Author

Choose a reason for hiding this comment

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

This still wouldn't have caught it because this targeting information comes from Offerings and not an Offering 🤷‍♂️

Targeting context is ONLY in the current offering but when getting an Offering from placements, we get it from all so its not already included

@joshdholtz joshdholtz merged commit af6fca2 into main Mar 6, 2024
24 checks passed
@joshdholtz joshdholtz deleted the fix-for-placement-targeting-context branch March 6, 2024 16:58
joshdholtz pushed a commit that referenced this pull request Mar 6, 2024
**This is an automatic release.**

### Bugfixes
* Fix for passing `TargetingContext` when using
`currentOffering(forPlacement:)` (#3751) via Josh Holtz (@joshdholtz)
### Other Changes
* Remove unneeded tests for StoreKit2 with JWS (#3747) via Josh Holtz
(@joshdholtz)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix A bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants