Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Conversation

ManhOptimizely
Copy link
Collaborator

OptiGraphOptions is resolved as singleton instance, in some case, developer needs to use different OptiGraphOptions instances for connecting different servers so they would update OptiGraphOptions in runtime. Since it's singleton, it could be updated by other thread/scope and make incorrect requests. This fix change the constructor of GraphQueryBuilder from IOptions (singleton) to IOptionsSnapshot (scoped snapshot) for supporting developer update OptiGraphOptions in their scope request.

OptiGraphOptions is resolved as singleton instance, in some case, developer needs to use different OptiGraphOptions instances for connecting different servers so they would update OptiGraphOptions in runtime. Since it's singleton, it could be updated by other thread/scope and make incorrect requests.
This fix change the constructor of GraphQueryBuilder from IOptions<OptiGraphOptions> (singleton) to IOptionsSnapshot<OptiGraphOptions> (scoped snapshot) for supporting developer update OptiGraphOptions in their scope request.
@ManhOptimizely ManhOptimizely force-pushed the bugfix/Make-OptiGraphOptions-to-be-thread-safe branch from ea50a56 to 2a6a1e9 Compare July 22, 2025 01:26
@ManhOptimizely ManhOptimizely merged commit 2a6a1e9 into develop Jul 23, 2025
7 of 9 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant