You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhanced Validation Method:
The code now features an improved IsValid function that checks for any issues and provides detailed error messages which makes troubleshooting much quicker and easier.
New Utility Functions:
Additional utility functions have been introduced that assist with handling property types, value expressions, and conversions. This enhancements should improve the robustness and efficiency of the code.
Thread-safe Configuration Management:
Implementations in the GridifyGlobalConfiguration.cs have transitioned to AsyncLocal storage. This advancement leads to better thread safety when running several operations at once.
Enhanced Configuration Properties:
The getter/setter logic for configuration properties has been introduced to set default values and provide proper handling of threading logic, leading to a safer and more manageable configuration process.
Thread-specific Custom Operator Management:
New methods allow for the handling of custom operators designated to specific threads or asynchronous contexts. This tailoring should improve compatibility across different tasks.
Reset Configuration Values:
There's a new function to reset all thread-local configuration values. This helps to ensure a clean state for the next task, minimizing the risk of carry-over issues.
Unit Tests for Query Validation:
A comprehensive suite of unit tests for GridifyQuery validation has been added. Testing includes a wide array of scenarios, with the addition of support for custom mappers and complex queries contributing to the overall code quality.
Thread Safety Tests:
New tests have been put in place to ensure that concurrent configuration changes stay separate from one another. This inclusion ensures a safe multi-threaded environment improving the reliability of the code when operated in parallel.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Issue #179 -
GridifyGlobalConfigurationuses static properties causing race conditions in multi-threaded scenarios and test isolation issues.✅ Solution
Replaced static storage with
AsyncLocal<T>to provide:Changes
GridifyGlobalConfiguration.csto useAsyncLocal<T>ResetToDefaults()for test cleanupSetCustomOperators()/ClearCustomOperators()Issue179Tests.csTests
All new tests pass:
📊 Performance
Minimal overhead (~1-2ns for reads), negligible impact.
None! API remains exactly the same.
Fixes #179