Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Double Colon in Redis User Session ID Key #34

@yvesemmanuel

Description

@yvesemmanuel

Description

The Redis session service implementation contains a bug where user session keys are generated with double colons ("::") in the key pattern. This occurs in the RedisKeys.user_sessions() method, which constructs keys used to track all sessions for a specific user within an application.

Current Behavior

The key generation in redis_session_service.py currently produces:

{APP_PREFIX}::{app_name}:{user_id}

This results in keys like: adk::my_app::user_123

Expected Behavior

The key should follow a consistent single-colon delimiter pattern:

{APP_PREFIX}{app_name}:{user_id}

Resulting in keys like: adkmy_app:user_123

Root Cause

In the RedisKeys.user_sessions() method, the APP_PREFIX constant already contains a trailing colon, but the f-string adds an additional colon separator:

return f"{State.APP_PREFIX}:{app_name}:{user_id}"  # Creates double colon

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions