Skip to content

Chris/sch 4043 cache rulesengineflags in redis#79

Merged
cbrady merged 7 commits intomainfrom
chris/sch-4043-cache-rulesengineflags-in-redis
Aug 12, 2025
Merged

Chris/sch 4043 cache rulesengineflags in redis#79
cbrady merged 7 commits intomainfrom
chris/sch-4043-cache-rulesengineflags-in-redis

Conversation

@cbrady
Copy link
Contributor

@cbrady cbrady commented Aug 1, 2025

No description provided.

@cbrady cbrady requested a review from a team as a code owner August 1, 2025 14:42
@cbrady cbrady force-pushed the chris/sch-4043-cache-rulesengineflags-in-redis branch from 991c19f to d8d5e3b Compare August 1, 2025 16:57
@cbrady cbrady requested a review from Copilot August 1, 2025 17:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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
bpapillon previously approved these changes Aug 11, 2025
@cbrady cbrady force-pushed the chris/sch-4043-cache-rulesengineflags-in-redis branch from a8ada62 to 2e3bb59 Compare August 12, 2025 04:29
@cbrady cbrady requested a review from bpapillon August 12, 2025 13:52
@cbrady cbrady merged commit d4ca2d2 into main Aug 12, 2025
6 checks passed
@cbrady cbrady deleted the chris/sch-4043-cache-rulesengineflags-in-redis branch August 12, 2025 15:46
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.

2 participants