Chris/sch 4043 cache rulesengineflags in redis#79
Merged
Conversation
991c19f to
d8d5e3b
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements Redis caching for rules engine flags in the datastream client to improve performance and reduce latency. The changes refactor flag checking logic to leverage cached resources and introduce schema versioning for cache keys to handle data structure changes.
- Adds Redis cache support for flags alongside existing company/user caching
- Implements schema versioning system to prevent cache invalidation issues during model changes
- Refactors flag checking flow to prioritize cached resources over API calls
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
src/SchematicHQ.Client/Schematic.cs |
Refactors CheckFlag method to extract API logic and improve datastream integration |
src/SchematicHQ.Client/RulesEngine/Utils/VersionGenerator.cs |
Adds schema version generator for cache key versioning |
src/SchematicHQ.Client/RulesEngine/Utils/TypeConverter.cs |
Updates Boolean enum value to Bool for consistency |
src/SchematicHQ.Client/Datastream/DatastreamClientAdapter.cs |
Enhances flag checking with resource validation and error handling |
src/SchematicHQ.Client/Datastream/Client.cs |
Implements Redis caching for flags and schema-versioned cache keys |
| Multiple test files | Updates tests to accommodate new caching behavior and API changes |
Comments suppressed due to low confidence (1)
src/SchematicHQ.Client/Datastream/DatastreamClientAdapter.cs:150
- [nitpick] The error message should be more descriptive and consistent with other error messages in the codebase. Consider: "Datastream connection is not available".
throw new InvalidOperationException("Not connected to datastream");
bpapillon
requested changes
Aug 8, 2025
bpapillon
previously approved these changes
Aug 11, 2025
a8ada62 to
2e3bb59
Compare
bpapillon
approved these changes
Aug 12, 2025
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.