google / google/adk-python-community
Double Colon in Redis User Session ID Key
- 主要语言
- Python
- 星标
- 182
- 派生
- 75
- PR 合并指标
- 30 天内没有已合并 PR
描述
## 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
```
贡献指南
调研方向
打开 redis_session_service.py,检查 RedisKeys.user_sessions() 方法,从 APP_PREFIX 定义和当前的键构造方式开始。确认生成的用户会话键使用了预期的分隔符模式,然后检查现有的 Redis 会话测试或键生成调用位置,以确认最终格式。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python, redis
- 领域
- backend, databases
- Issue 类型
- 缺陷
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 活跃度
- 停滞
- 描述清晰度
- 描述清楚
- 新手友好度
- 55/100