Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 565664d

Browse files
committed
update key
1 parent b4a2815 commit 565664d

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

gapic/utils/cache.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,17 @@ def wrapper(self, *, collisions, **kwargs):
8888
if context_cache is None:
8989
return func(self, collisions=collisions, **kwargs)
9090

91-
# 2. Create the cache key
92-
collisions_key = frozenset(collisions) if collisions else None
93-
key = (id(self), collisions_key)
91+
col_key = frozenset(collisions) if collisions else None
92+
93+
# CRITICAL FIX: Include these flags in the key.
94+
# This prevents the "Summary" (skip_fields=True) from being returned
95+
# when the template asks for the "Full" (skip_fields=False) object.
96+
skip_key = kwargs.get('skip_fields', False)
97+
98+
visited = kwargs.get('visited_messages')
99+
vis_key = tuple(sorted(id(m) for m in visited)) if visited else None
100+
101+
key = (id(self), col_key, skip_key, vis_key)
94102

95103
# 3. Check Cache
96104
if key in context_cache:

0 commit comments

Comments
 (0)