rxjs icon indicating copy to clipboard operation
rxjs copied to clipboard

Async subject and ReplaySubject still accept next messages

Open ihalilbayram opened this issue 2 months ago • 0 comments

Describe the bug

Both AsyncSubject and ReplaySubject overrides Subject next method, but even _throwIfClosed checked in every error/next/complete messages, is not checked in these two overriden methods. It just check whether stopped or not, but not checked whether closed or not of course it is checked by calling super.next() method but if I manually set closed flag to true, the Subject become closed but not isStopped then the buffer in ReplaySubject and _value in the AsynSubject effected with this value

next(value){ if (!isStopped) { _buffer.push(value); ...
} this._trimBuffer(); super.next(value) }

Expected behavior

if a Subject closed, none of the message receieved/transmitted here the message receieved updates the buffer/last value shouldn't this too

Reproduction code


Reproduction URL

No response

Version

7.8.2

Environment

No response

Additional context

No response

ihalilbayram avatar Oct 27 '25 13:10 ihalilbayram