mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(backend): prevent caching of None graph results to handle dynamic permissions
When a graph is not found/accessible, we now clear the cache entry rather than caching the None result. This prevents issues with store listing permissions where a graph becomes accessible after approval but the cache still returns the old 'not found' result.
This commit is contained in:
@@ -672,6 +672,9 @@ async def get_graph(
|
||||
version=version,
|
||||
user_id=user_id,
|
||||
)
|
||||
# If graph not found, clear cache entry as permissions may have changed
|
||||
if not graph:
|
||||
cache.get_cached_graph.cache_delete(graph_id, version, user_id)
|
||||
else:
|
||||
graph = await graph_db.get_graph(
|
||||
graph_id,
|
||||
|
||||
Reference in New Issue
Block a user