fix(task): preserve task state and paging during polling - #2795
Merged
Merged
Conversation
HandSonic
force-pushed
the
fix/task-state-races
branch
from
September 3, 2026 08:35
acb4118 to
3b2636b
Compare
HandSonic
force-pushed
the
fix/task-state-races
branch
from
September 3, 2026 21:08
3b2636b to
17f9893
Compare
Keep completed task states and newly loaded history while polling. Invalidate stale responses on deletion or close and surface retryable load failures.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issue
N/A - no matching public issue was linked to this task lifecycle and pagination fix.
Summary
Unexpected executor cancellation exceptions could leave tasks marked RUNNING without a cancellation request. They now persist as FAILED unless the task cancellation token was set.
Task-center polling and pagination now merge records by ID and update time, preserve terminal states and newly loaded history, and reject responses invalidated by deletion or closing the panel. Slow pagination can finish while polling continues. Failed loads release loading state, show an error, and can be retried.
Affected surfaces
Verification
yarn test:task-center: passed, including six tests of the actual store with a controlled network boundary.yarn lint: ESLint and Stylelint passed.yarn build:web:community --app_version=0.0.0: full prebuild, production build, and bundle verification passed. The final frontend source is byte-identical to the built and browser-tested version.mvn -B -o -f chat2db-community-server/pom.xml -pl :chat2db-community-domain-core -am -Dmaven.test.skip=false -DskipTests=false '-Dtest=LocalCookieTest,LocalTaskManagerTest,TaskExecutorRegistryTest,RunningTaskTest,TaskServiceImplTest' -Dsurefire.failIfNoSpecifiedTests=false -Dmaven.test.failure.ignore=false package: 23 task-related tests passed, zero failures/errors/skips; package succeeded. No LocalCookie test was discovered by that selector.git diff --check: passed.Risk and compatibility
Reviewer map
src/store/importExport/index.ts,taskCenterUtils.ts,taskCenterStore.test.ts, thenTaskRunner.runand the cancellation tests inLocalTaskManagerTest.Contributor declaration
AI assistance: OpenAI Codex assisted with review, the polling/pagination fix, regression tests, local validation, and integration with current main.