google / google/adk-python-community

Double Colon in Redis User Session ID Key

Open
#34 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
182
Forks
75
PR merge metrics
No merged PRs in 30d

Description

## 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:

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

Contributor guide

Open the contributing guide

Research direction

Open redis_session_service.py and inspect the RedisKeys.user_sessions() method, starting with the APP_PREFIX definition and the current key construction. Verify that the generated user-session key uses the expected delimiter pattern, then check the existing Redis session tests or key-generation call sites for the resulting format.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
backend, databases
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.