Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

observeOnce should use ES Observable call pattern #2989

Closed
compulim opened this issue Mar 7, 2020 · 0 comments · Fixed by #2993
Closed

observeOnce should use ES Observable call pattern #2989

compulim opened this issue Mar 7, 2020 · 0 comments · Fixed by #2993
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior.

Comments

@compulim
Copy link
Contributor

compulim commented Mar 7, 2020

Version

4.8.0

Describe the bug

In core/src/sagas/effects/observeOnce.js, the call pattern for Observable.subscribe is using older format (RxJS) instead of ES Observable.

The new signature is being used in observeEach.js.

This is causing test running in Jest not able to subscribe to the value correct.

The correct one is:

- subscription = observable.subscribe(resolve, reject, resolve);
+ subscription = observable.subscribe({
+   complete: resolve,
+   error: reject,
+   next: resolve
+ })

Steps to reproduce

  1. Write a test using Jest to call DIRECT_LINE/POST_ACTIVITY, and expect DIRECT_LINE/POST_ACTIVITY_FULFILLED

Expected behavior

The POST_ACTIVITY_FULFILLED action should be dispatched back.

Instead, since observeOnce is not working under Jest + Node.js and failed silently, the DIRECT_LINE/POST_ACTIVITY_FULFILLED is never dispatched. Instead, it dispatched POST_ACTIVITY_REJECTED.

Additional context

Tagging @youyu16.

[Bug]

@compulim compulim added bug Indicates an unexpected problem or an unintended behavior. Pending customer-reported Required for internal Azure reporting. Do not delete. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. and removed Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Required for internal Azure reporting. Do not delete. labels Mar 7, 2020
@compulim compulim removed the Pending label Mar 7, 2020
@compulim compulim mentioned this issue Mar 7, 2020
1 task
@cwhitten cwhitten added the R9 label Mar 9, 2020
@compulim compulim mentioned this issue May 15, 2020
34 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants