google / google/adk-python-community

Double Colon in Redis User Session ID Key

Offen
#34 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
182
Forks
75
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.