question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fromPromise is not disposed correctly

See original GitHub issue

Summary

Creating a stream with fromPromise and then unsubscribing to it, most will execute the sequential steps even though the stream should be disposed

As example:

    most
      .fromPromise(new Promise(resolve => setTimeout(resolve, 2000)))
      .tap(() => console.log('1'))
      .merge(most.just().delay(1500)) // since 1500 < 2000, the fromPromise-stream should be unsubscribed at 1500 and any result after that should be ignored
      .take(1)
      .subscribe({
        next: () => console.log('Finished'),
      })

Expected result

console.log('Finished')

Actual Result

console.log('Finished') console.log('1')

Versions

Seems to have been introduced when the following refactor was done: https://gist.github.com/briancavalier/a27ddc247dd118ae5508

  • most.js: 1.7.2

Steps to reproduce

See above

Code to reproduce

    most
      .fromPromise(new Promise(resolve => setTimeout(resolve, 2000)))
      .tap(() => console.log('1'))
      .merge(most.just().delay(1500)) // since 1500 < 2000, the fromPromise-stream should be unsubscribed at 1500 and any result after that should be ignored
      .take(1)
      .subscribe({
        next: () => console.log('Finished'),
      })

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
briancavaliercommented, Apr 23, 2020

@marcus13371337 We published 1.8.1 with the fix.

2reactions
mikeduminycommented, Apr 23, 2020

@briancavalier the changelog in the releases on github hasn’t been updated since 1.7.2 What changed in 1.8.0?

Read more comments on GitHub >

github_iconTop Results From Across the Web

fromPromise does not exist on type Observable - Stack Overflow
Property 'fromPromise' does not exist on type 'typeof Observable'. Observable was imported like: import { Observable } from "rxjs/Observable";.
Read more >
Asynchronous unsubscribe method #4222 - ReactiveX/rxjs
The thing is that res.dispose() is async because it sends a request to a server, which is required to properly dispose of the...
Read more >
Observable | RxJS API Document - ReactiveX
Creates an Observable that emits no items to the Observer and immediately ... this Observable keeps the subscription from being disposed automatically.
Read more >
Observable - Babylon.js Documentation
Internal disposal method for observable-based coroutine scheduler instance. ... whether or not one observer registered with the given mask is handled ...
Read more >
SMART TRASH: Study on RFID tags and ... - RAND Corporation
Waste that is not correctly disposed of can be automatically identified and separated based on RFID. Based on expert feedback, use cases 1...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found