feat(redis): add key hash-tag convention#355
Merged
Merged
Conversation
Redis Cluster key builders need one shared way to create safe hash tags. Add helper functions for normalized key parts, tag creation, and same-tag checks. Callers can now build and verify Redis hash-tag conventions consistently.
Auth verification cleanup touches related Redis keys together in the same flow. Add the email digest hash tag to code, attempt, and last-send keys and cover the shared tag. Verification keys now remain colocated for Redis Cluster multi-key cleanup.
Backend and browser-worker share live browser session keys across Redis. Tag active, live-session, and stream-token keys by the authoritative user or session scope. Shared browser-session keys now have a Cluster-ready slot contract.
The browser-session Redis key contract spans backend and worker code. Update existing Redis assertions and add focused tests for approved hash-tag shapes. Future browser-session key changes now fail when they break the shared tag contract.
Publish lock keys are project-scoped coordination state for Redis-backed workers. Add a project hash tag to publish lock keys and cover the generated key shape. Publish lock ownership can now be colocated with future project-scoped Redis work.
Resolve-cache invalidation scans all actor entries for one media asset. Add an asset hash tag to resolve-cache keys and update cache assertions. Actor-specific resolve cache entries for one asset now share a Redis Cluster slot.
Project-list cache invalidation coordinates data keys with one generation key. Add a dashboard project-list family hash tag to cache and generation keys. Project-list cache keys now stay colocated for Cluster-safe invalidation work.
Redis inventory needs to classify the tagged key shapes emitted by the application. Update declared patterns, fixtures, and inventory tests for the approved hash-tag formats. Operational keyspace scans now keep the new keys under known ownership metadata.
Redis Cluster follow-up work needs an explicit convention for new key construction. Document approved tag scopes, examples, audit strategies, and intentionally deferred groups. Future Redis key work now has a single reference for Cluster slot decisions.
Existing Redis docs still described pre-convention key shapes. Link the audit to the convention and update browser-session and publish-lock examples. Documentation examples now match the tagged keys emitted by the code.
e23c932 to
9ece654
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Feature Description
Implementation Approach
backend/internal/pkg/rediskeyfor normalized key parts, hash-tag creation, and same-tag checks.Testing
bash script/ci/backend.sh.bash script/ci/browser-worker.sh.golangci-lint runfrombackend.golangci-lint runfrombrowser-worker.go test ./internal/handlers ./internal/services/publish ./internal/services/browser_sessionfrombackend.ruby script/redis/test_keyspace_inventory.rb.bash script/ci/content-pipeline-integration.shbecause it builds and launches the Rust service locally.bash script/ci/kubernetes.sh; earlier local run reached the Redis capacity alert step and was blocked by missingpromtoolplus unavailable Docker/OrbStack fallback.Related