Repository navigation
Preserve existing Redis aliases during normalization - #1179
Merged
Conversation
Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
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.
Summary
Fixes #1176.
Return from Alias initialization when its argument is already an Alias. This supports the identity-preserving
__new__path without asserting that the already-typed argument is a string.Automatic subscriber handler discovery and APIs accepting
Alias | strnow work through repeated normalization. Identity, value, hashing, wire keys, JSON serialization and unrelated-input rejection are retained. Redis connection policy and routing semantics are unchanged.Testing
python -m pytest -q filescan/python-filescan/tests/test_redis_alias_identity.py15 focused tests passed; 10 fail on unchanged main. Tests cover repeated normalization, empty/Unicode names, hashing, mappings, reassignment, automatic subscribers, message dispatch, channel removal/re-addition, publication, subscriber counts and existing subclass instances.
Real filescan classes and Pydantic serialization are used. Redis clients and I/O methods are mocked; no Redis/Valkey server, external endpoint or socket listener was started.
89 tests passed in an isolated combined check containing these three fixes and the current #1155, #1166 and #1174 changes. That run includes the existing timezone and worker-cancellation regressions; the separate chunk-size suite was not rerun. No earlier production changes are included in this PR.
Tested on macOS with Python 3.12 and the pinned AnyIO 4.14.2. New-test formatting, scoped syntax/lint checks and
git diff --checkpass. No dependency or workflow changes. Full Malcolm deployment testing was not run.