Repository navigation
fix: align state prefixes with State constants - #1650
Open
hemasekhar-p wants to merge 1 commit into
Open
hemasekhar-p wants to merge 1 commit into
hemasekhar-p wants to merge 1 commit into
Conversation
This was referenced Oct 12, 2026
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.
Please ensure you have read the contribution guide before creating a pull request.
Link to Issue or Description of Change
1. Link to an existing issue (if applicable):
app:/user:state prefixes, so app and user state are never shared across sessions #1645Problem:
In
FirestoreSessionService.appendEvent, state key routing checked for non-canonical string prefixes (app and user) rather than ADK's standard prefix constantsState.APP_PREFIX. Consequently:Mutations destined for shared application state (app:) or user state (user:) fell through into individual session state rather than being routed to their dedicated Firestore collections (app-state and user-state).
Ephemeral keys matching
State.TEMP_PREFIX("temp:") were not skipped and were unintentionally persisted to durable session state.The deletion sentinel
State.REMOVEDwas treated as a normal value rather than executingFieldValue.delete()in Firestore orsession.state().remove(key)in session memory.Solution:
Updated
FirestoreSessionService.appendEventto route usingState.APP_PREFIXandState.USER_PREFIX, stripping the prefix before saving to the respective Firestore document.Added an explicit check for
State.TEMP_PREFIXto ignore ephemeral state during persistence.Mapped
State.REMOVEDtoFieldValue.delete()for scoped Firestore mutations and invokedsession.state().remove(key)for session state.Testing Plan
Unit Tests:
Manual End-to-End (E2E) Tests:
Validated the issue before and after fix manually in local.
Checklist