Preserve user-supplied ConsumerConfig.filter_subject on subscribe - #990
Preserve user-supplied ConsumerConfig.filter_subject on subscribe#990caspervonb wants to merge 2 commits into
Conversation
The auto-create path guarded on filter_subjects (plural) but then assigned filter_subject (singular), so a consumer config that set only the singular filter_subject had it silently overwritten with the subscribe subject. Guard on both before defaulting.
|
Claude finished @caspervonb's task in 1m 24s —— View job PR Review
The fix is correct and well-targeted. The push-subscribe auto-create path checked One issue found: the same bug exists in # nats/src/nats/js/client.py ~line 598-600
# Auto created consumers use the filter subject, unless filter_subjects is set.
if not config.filter_subjects: # ← same bug: ignores user-supplied filter_subject
config.filter_subject = subjectThis should receive the identical fix: Test (nats/tests/test_js.py): the regression test is clear and sufficient for the push case. Minor note — |
The pull_subscribe auto-created consumer guard only checked filter_subjects, so a user-supplied singular filter_subject on the ConsumerConfig was clobbered with the subscribe subject. Mirror the guard used on the push subscribe path so both filters are honored.
The auto-create path guarded on
filter_subjects(plural) but assignedfilter_subject(singular), so a config that set only the singular field had it silently overwritten with the subscribe subject.Fixes #501.