Skip to content

Conversation

@fabriziodemaria
Copy link
Contributor

@fabriziodemaria fabriziodemaria commented Jul 3, 2025

This PR

Creates a deep copy of the evaluation context before passing it into the provider. While the original evaluation context class could be mutated by the hosting application, the copy will not be affected, ensuring higher thread safety guarantees for the consuming provider.
Mutable classes are made thread safe as well.

Related Issues

Race conditions within onContextSet implementation have been reported for some Swift Providers.

How to test

Unit tests provided for the deep copy, but difficult to test the race condition possibility.

Signed-off-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
Signed-off-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
@fabriziodemaria fabriziodemaria changed the title feat: Improves thread safety contract with providers feat: Improves EvaluationContext thread safety Jul 3, 2025
Signed-off-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
Signed-off-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
Signed-off-by: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
@fabriziodemaria fabriziodemaria merged commit 65cb295 into main Jul 4, 2025
15 of 16 checks passed
@fabriziodemaria fabriziodemaria deleted the ctx-copy branch July 4, 2025 11:29
fabriziodemaria pushed a commit that referenced this pull request Jul 4, 2025
🤖 I have created a release *beep* *boop*
---


##
[0.3.1](0.3.0...0.3.1)
(2025-07-04)


### ✨ New Features

* Adding Cocoapods support
([#61](#61))
([f481a51](f481a51))
* Adds watchOS / tvOS support
([#67](#67))
([3a5af18](3a5af18))
* Improves EvaluationContext thread safety
([#69](#69))
([65cb295](65cb295))


### 🧹 Chore

* remove podspec update script and adjust release configuration
([#65](#65))
([2903008](2903008))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

3 participants