Skip to content

exhaustAll never completes when lastValueFrom is used #6910

@mlegenhausen

Description

@mlegenhausen

Describe the bug

exhaustAll does not behave the same as exhaustMap(identity)

Expected behavior

I would expect that exhaustAll should behave the same as exhaustMap(identity)

Reproduction code

import { exhaustAll, exhaustMap, firstValueFrom, lastValueFrom, of, identity } from 'rxjs'

const a = of(of(1))

const a1 = await firstValueFrom(a.pipe(exhaustMap(identity)))
assert.deepStrictEqual(a1, 1) // success

const a2 = await firstValueFrom(a.pipe(exhaustAll()))
assert.deepStrictEqual(a2, 1) // success

const a3 = await lastValueFrom(a.pipe(exhaustMap(identity)))
assert.deepStrictEqual(a3, 1) // success

const a4 = await lastValueFrom(a.pipe(exhaustAll()))
assert.deepStrictEqual(a4, 1) // timeout cause `a4` never resolves

Reproduction URL

No response

Version

7.5.5

Environment

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.xIssues and PRs for version 6.x7.xIssues and PRs for version 7.xbugConfirmed bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions