Skip to content

Preserve existing Redis aliases during normalization - #1179

Merged
mmguero merged 1 commit into
cisagov:sylvesterkaczmarek-mergesfrom
sylvesterkaczmarek:fix/filescan-redis-alias-idempotency-20261007
Oct 7, 2026
Merged

mmguero merged 1 commit into
cisagov:sylvesterkaczmarek-mergesfrom
sylvesterkaczmarek:fix/filescan-redis-alias-idempotency-20261007

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

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 | str now 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.py

15 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 --check pass. No dependency or workflow changes. Full Malcolm deployment testing was not run.

Signed-off-by: Sylvester Kaczmarek <16242628+sylvesterkaczmarek@users.noreply.github.com>
@mmguero
mmguero changed the base branch from main to sylvesterkaczmarek-merges October 7, 2026 15:48
@mmguero mmguero self-assigned this Oct 7, 2026
@mmguero mmguero added the pipeline Relating to carving (extraction) of files from traffic and the scanning of those files label Oct 7, 2026
@mmguero mmguero added this to Malcolm Oct 7, 2026
@mmguero mmguero added this to the v26.10.0 milestone Oct 7, 2026
@mmguero
mmguero merged commit 69ad441 into cisagov:sylvesterkaczmarek-merges Oct 7, 2026
@mmguero mmguero moved this from Done to Released in Malcolm Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pipeline Relating to carving (extraction) of files from traffic and the scanning of those files

Projects

Status: Released

Development

Successfully merging this pull request may close these issues.

Normalizing an existing Redis Alias raises AssertionError and breaks subscribers

2 participants