Update Expert insights mode use app cache#7138
Open
Steve-Mcl wants to merge 3 commits into1178-app-cache-ttlfrom
Open
Update Expert insights mode use app cache#7138Steve-Mcl wants to merge 3 commits into1178-app-cache-ttlfrom
Steve-Mcl wants to merge 3 commits into1178-app-cache-ttlfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## 1178-app-cache-ttl #7138 +/- ##
===================================================
Coverage 76.57% 76.57%
===================================================
Files 405 405
Lines 20382 20384 +2
Branches 4905 4902 -3
===================================================
+ Hits 15607 15609 +2
Misses 4775 4775
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Description
This pull request refactors the Expert MCP access token caching system to use the application's centralized cache abstraction instead of the direct
lru-cachedependency. It also updates affected API routes and tests to handle the now-async cache methods. These changes improve consistency, reliability, and testability of token caching and invalidation.Caching system refactor:
lru-cachewith the application's cache abstraction (app.caches) inforge/expert/index.js, including new helper methods for cache access and token expiry handling. Now, token caching, retrieval, and clearing are all async and use the shared cache infrastructure. [1] [2] [3]API updates:
forge/routes/api/expert.jsandforge/routes/api/project.jsto await the now-async token cache methods, ensuring proper cache handling in API endpoints. [1] [2]Test updates:
test/unit/forge/routes/api/expert_spec.jsto await the async cache methods, ensuring tests correctly interact with the new caching logic. [1] [2] [3] [4] [5] [6] [7]Related Issue(s)
closes #7137
Checklist
flowforge.yml?FlowFuse/helmto update ConfigMap TemplateFlowFuse/CloudProjectto update values for Staging/ProductionLabels
area:migrationlabel