Implementation of stream.purge()
seems wrong for consumers with multiple filter subjects
#4826
Labels
defect
Suspected defect such as a bug or regression
Observed behavior
While reading the code of
stream.purge()
I found what looks like an oversight:https://github.com/nats-io/nats-server/blob/main/server/stream.go#L2005 and the lines below check if the subject of the purge request matches the consumer's filter subject. A consumer can however have multiple filter subjects and this is not taken into account here.
Expected behavior
The code should probably not use the consumer's config, but instead check if the purge subject is a subset match for any of the consumers's subject filters by accessing
o.subj
(https://github.com/nats-io/nats-server/blob/main/server/consumer.go#L311).Server and client version
server version 2.10.5
Host environment
No response
Steps to reproduce
No response
The text was updated successfully, but these errors were encountered: