ReactiveX / ReactiveX/rxjs

The `isScheduler()` util bug is causing observables created by `of()` to be hanged

Open
#6,584 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
31.7k
Forks
3k
PR merge metrics
No merged PRs in 30d

Description

Bug Report

Current Behavior
The observable created by of() operator is hanged if the param object has the property name schedule with a function value.

Expected behavior
The observable created by of() operator should never hanged if the param object has the property name schedule with a function value.
This bug is quite annoying because objects with the schedule field of function type is not rare.

Reproduction

import { of } from 'rxjs';

const value = {
  schedule: function() {}
  //... my other data fields here
};

of(value).subscribe(console.log); // the value is never printed

Environment

  • Runtime: node v14.16.1
  • RxJS version: 7.3.0

Possible Solution
maybe to have extra/special identity field for the internal Scheduler objects in order to detect them precisely.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the isScheduler() utility and the of() entry point, then reproduce the behavior using the linked StackBlitz example. Done means an observable created with of() emits an object whose schedule property is a function instead of hanging.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.