Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request migrates the Redis session service to a new versioned key schema (v2) using unpadded URL-safe Base64 encoding to prevent key collisions, and adds identity verification checks across session operations. The review feedback suggests reverting the transaction-based delete in delete_session to a direct delete to improve performance and avoid blocking the deletion of corrupted sessions. Additionally, it recommends using exists instead of get in append_event to prevent redundant double-reading and parsing of large session JSONs.
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.
Fixes #7464
Change
Redis session, user-state, and app-state keys now use distinct type tags and unpadded Base64URL identity components under a versioned
v2:namespace. With the default prefix, new keys start withadk:session:v2:. Reads and appends reject mismatched stored session identities; deletion addresses the exact v2 key. Listing also confirms each scanned key is the canonical v2 key for its stored identity, so a legacy key that matches the scan pattern is ignored. A watched transaction keeps session and state writes together when appending events.Compatibility
This is a cutover, not an automatic migration. Existing Redis keys stay untouched and are not read by the new format. The README describes expiry and careful manual cleanup. There is no legacy read fallback because ambiguous old keys could preserve the original alias. This PR is a draft so maintainers can decide whether that cutover is acceptable or prefer a specific migration plan. The existing same-identity append retry behavior after a concurrent deletion or expiry is unchanged.
Testing
git diff --checkpassed.