Skip to content

Async subject and ReplaySubject still accept next messages #7576

@ihalilbayram

Description

@ihalilbayram

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions