Skip to content

fix: key builder encoding, reset_settings, and cache_evict guard#30

Open
emiliano-go wants to merge 1 commit into
redis:mainfrom
emiliano-go:fix/key-settings-management
Open

fix: key builder encoding, reset_settings, and cache_evict guard#30
emiliano-go wants to merge 1 commit into
redis:mainfrom
emiliano-go:fix/key-settings-management

Conversation

@emiliano-go

Copy link
Copy Markdown

Changes

Bug: Key builder ambiguity with special characters in query values

default_key_builder used : as the key segment delimiter and joined query
params with :. Values containing :, =, or & created ambiguous keys
that could not round-trip correctly.

Fix: Changed the query-params segment to use & as a separator and
URL-encode values (%3A for :, %26 for &, %3D for =).

Bug: Missing reset_settings() for testing

get_settings() uses @lru_cache, caching the RedisSettings instance
forever. Tests that mutate environment variables cannot force a fresh reload.

Fix: Added reset_settings() that calls get_settings.cache_clear().
Exported from the public API.

Bug: cache_evict() with no args wipes ALL cache keys

Calling cache_evict() without eviction_group and without key_builder
silently deleted every key under the global prefix.

Fix: Added an early ValueError when both arguments are absent. To
intentionally wipe all keys the caller must provide an explicit
eviction_group.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant