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): cancel forkApi.delay and forkApi.pause if listener is cancelled or completed #2074

Merged
merged 1 commit into from
Feb 26, 2022

Conversation

markerikson
Copy link
Collaborator

This is a repeat of #2073 , which accidentally got closed automatically because it was targeted at another PR branch.

Original description:

Follow up of #2070

Changes

-forkApi.delay and forkApi.pause rejects if listener is cancelled or completed.

  • forkApi.signal notifies the task as aborted if parent listener is cancelled or completed.
  • Byte shaving

…lled or completed

-- Test log

$ yarn workspace @reduxjs/toolkit run test
 PASS  src/query/tests/buildHooks.test.tsx (21.737 s)
 PASS  src/listenerMiddleware/tests/listenerMiddleware.test.ts
 PASS  src/tests/createAsyncThunk.test.ts
 PASS  src/query/tests/createApi.test.ts
 PASS  src/entities/tests/sorted_state_adapter.test.ts
 PASS  src/query/tests/fetchBaseQuery.test.tsx
 PASS  src/tests/createReducer.test.ts
 PASS  src/entities/tests/unsorted_state_adapter.test.ts
 PASS  src/query/tests/cacheLifecycle.test.ts
 PASS  src/query/tests/errorHandling.test.tsx
 PASS  src/query/tests/queryLifecycle.test.tsx
 PASS  src/tests/serializableStateInvariantMiddleware.test.ts
 PASS  src/tests/matchers.test.ts
 PASS  src/listenerMiddleware/tests/fork.test.ts
 PASS  src/query/tests/devWarnings.test.tsx
 PASS  src/query/tests/queryFn.test.tsx
 PASS  src/query/tests/refetchingBehaviors.test.tsx
 PASS  src/tests/immutableStateInvariantMiddleware.test.ts
 PASS  src/query/tests/useMutation-fixedCacheKey.test.tsx
 PASS  src/listenerMiddleware/tests/effectScenarios.test.ts
 PASS  src/query/tests/optimisticUpdates.test.tsx
 PASS  src/tests/createSlice.test.ts
 PASS  src/query/tests/retry.test.ts
 PASS  src/tests/getDefaultMiddleware.test.ts
 PASS  src/tests/configureStore.test.ts
 PASS  src/query/tests/matchers.test.tsx
 PASS  src/listenerMiddleware/tests/useCases.test.ts
 PASS  src/query/tests/buildThunks.test.tsx
 PASS  src/tests/createAction.test.ts
 PASS  src/tests/combinedTest.test.ts
 PASS  src/query/tests/fakeBaseQuery.test.tsx
 PASS  src/query/tests/buildMiddleware.test.tsx
 PASS  src/entities/tests/state_selectors.test.ts
 PASS  src/query/tests/invalidation.test.tsx
 PASS  src/query/tests/cacheCollection.test.ts
 PASS  src/query/tests/utils.test.ts
 PASS  src/query/tests/cleanup.test.tsx
 PASS  src/query/tests/polling.test.tsx
 PASS  src/entities/tests/entity_state.test.ts
 PASS  src/query/tests/copyWithStructuralSharing.test.ts
 PASS  src/entities/tests/state_adapter.test.ts
 PASS  src/query/tests/buildSlice.test.ts
 PASS  src/entities/tests/utils.spec.ts
 PASS  src/query/tests/apiProvider.test.tsx
 PASS  src/query/tests/defaultSerializeQueryArgs.test.ts
 PASS  src/tests/createDraftSafeSelector.test.ts
 PASS  src/tests/isPlainObject.test.ts

Test Suites: 2 skipped, 47 passed, 47 of 49 total
Tests:       23 skipped, 685 passed, 708 total
Snapshots:   51 passed, 51 total
Time:        65.182 s
Ran all test suites.
@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 19b8904:

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

@github-actions
Copy link

size-limit report 📦

Path Size
1. entry point: @reduxjs/toolkit (cjs.production.min.js) 14.5 KB (+0.09% 🔺)
1. entry point: @reduxjs/toolkit (esm.js) 12.33 KB (+0.01% 🔺)
1. entry point: @reduxjs/toolkit/query (cjs.production.min.js) 24.24 KB (+0.05% 🔺)
1. entry point: @reduxjs/toolkit/query (esm.js) 19.01 KB (0%)
1. entry point: @reduxjs/toolkit/query/react (cjs.production.min.js) 26.54 KB (+0.05% 🔺)
1. entry point: @reduxjs/toolkit/query/react (esm.js) 21.7 KB (0%)
2. entry point: @reduxjs/toolkit (without dependencies) (cjs.production.min.js) 7.29 KB (+0.22% 🔺)
2. entry point: @reduxjs/toolkit (without dependencies) (esm.js) 7.24 KB (+0.15% 🔺)
2. entry point: @reduxjs/toolkit/query (without dependencies) (cjs.production.min.js) 10.12 KB (0%)
2. entry point: @reduxjs/toolkit/query (without dependencies) (esm.js) 10.55 KB (0%)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (cjs.production.min.js) 2.8 KB (0%)
2. entry point: @reduxjs/toolkit/query/react (without dependencies) (esm.js) 3.21 KB (0%)
3. createSlice (esm.js) 5.08 KB (0%)
3. createEntityAdapter (esm.js) 6.44 KB (0%)
3. configureStore (esm.js) 5.82 KB (0%)
3. createApi (esm.js) 17.22 KB (0%)
3. createApi (react) (esm.js) 19.93 KB (0%)
3. fetchBaseQuery (esm.js) 11.6 KB (0%)
3. setupListeners (esm.js) 10.46 KB (0%)
3. ApiProvider (esm.js) 18.56 KB (0%)

@markerikson markerikson merged commit effab14 into v1.8.0-integration Feb 26, 2022
@markerikson markerikson deleted the feature/listener-abort-task branch February 26, 2022 23:57
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.

2 participants