You are working on the hyperswitch repository (Rust payment processing system).…
- User
You are working on the hyperswitch repository (Rust payment processing system).
REPOSITORY SETUP:
- Repository: juspay/hyperswitch
- Working directory: ./repos/hyperswitch_pool_9 (already cloned)
- Base commit: 54e910582fac9bd6fe300a9a96926adf5123403e
- Task ID: juspay__hyperswitch-7891
- Version: v1.113.0
TASK DESCRIPTION: Bug: Standardize Redis Key Prefix for User Lineage Context
Currently, the lineage context is cached in Redis using tenant-specific key prefixes (public_, public_v2_). This causes inconsistencies across V1 and V2 environments — especially during login/logout flows — as lineage context data becomes deployment-specific.
Need to introduce a new Redis connection helper that overrides the prefix with the global value from config (global).
DETAILED CONTEXT & HINTS:
Type of Change
- Bugfix
- New feature
- Enhancement
- Refactoring
- Dependency updates
- Documentation
- CI/CD
Description
This PR updates the lineage context Redis caching logic to use a dedicated global Redis key prefix (
global) instead of the default tenant-scoped prefixes (public_,public_v2_), causing inconsistencies between deployments (i.e., v1 and v2).Introduced a new helper:
get_redis_connection_for_global_tenant- Fetches Redis connection with
key_prefixset toglobal. - Updated lineage context caching (
get_lineage_context_from_cache,set_lineage_context_in_cache) to use the global Redis connection
This will enable https://github.com/juspay/hyperswitch/pull/7871 to work with both v1 and v2 merchant accounts.
The redis-key should now be in the format of global:LINEAGE_CONTEXT_<user_id>
Additional Changes
- This PR modifies the API contract
Assistant
I'll help you implement the Redis key prefix standardization for user lineage context in the hyperswitch repository. Let me start by creating a plan and exploring the codebase to understand the current implementation.
Assistant
Let me first explore the codebase to understand how Redis is currently implemented and where lineage context caching is handled.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.