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

fix(alm): prevent zombie listeners caused by forked tasks #2070

Conversation

FaberVitale
Copy link
Contributor

Description

Prevents zombie listeners caused by forked tasks.

BREAKING CHANGE: forkedTask.result now rejects if parent listener is either completed or cancelled.

Other changes:

  1. Improve documentation
  2. Add '@examples-action-listener/*' to the
  3. "build:examples" script now builds '@examples-action-listener/*' too

Build log

$ yarn workspace @rtk-incubator/action-listener-middleware run build
Build "actionListenerMiddleware" to dist/esm:
       1744 B: index.modern.js.gz
       1565 B: index.modern.js.br
Build "actionListenerMiddleware" to dist/module:
      5.41 kB: index.js.gz
      2.16 kB: index.js.br
Build "actionListenerMiddleware" to dist/cjs:
       2.4 kB: index.js.gz
      2.16 kB: index.js.br

Test log

$ yarn workspace @rtk-incubator/action-listener-middleware run test --coverage
 PASS  src/tests/fork.test.ts
 PASS  src/tests/listenerMiddleware.test.ts
 PASS  src/tests/effectScenarios.test.ts
 PASS  src/tests/useCases.test.ts
---------------|---------|----------|---------|---------|-------------------
File           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
---------------|---------|----------|---------|---------|-------------------
All files      |    97.7 |    91.38 |   94.64 |   97.52 |                   
 exceptions.ts |     100 |        0 |     100 |     100 | 17                
 index.ts      |   97.37 |     97.5 |    92.5 |   97.28 | 190,214,252-253   
 task.ts       |   97.06 |       80 |     100 |    96.3 | 30                
 utils.ts      |     100 |    85.71 |     100 |     100 | 52                
---------------|---------|----------|---------|---------|-------------------

Test Suites: 4 passed, 4 total
Tests:       72 passed, 72 total
Snapshots:   0 total
Time:        6.386 s
Ran all test suites.

BREAKING CHANGE: forkedTask.result now rejects if parent listener is either completed or cancelled.
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 91f4c08:

Sandbox Source
Vanilla Configuration
Vanilla Typescript Configuration
rsk-github-issues-example Configuration
@examples-query-react/basic Configuration
@examples-query-react/advanced Configuration
@examples-action-listener/counter Configuration

@markerikson
Copy link
Collaborator

Sweet, merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants