Skip to content

fix: handle ConflictError in JobHandler and add corresponding tests#87

Open
razbroc wants to merge 3 commits intomasterfrom
fix/abort-would-publish-tasks
Open

fix: handle ConflictError in JobHandler and add corresponding tests#87
razbroc wants to merge 3 commits intomasterfrom
fix/abort-would-publish-tasks

Conversation

@razbroc
Copy link
Contributor

@razbroc razbroc commented Feb 11, 2026

This pull request introduces improved handling of conflict scenarios in job and task management, specifically ensuring that tasks are not erroneously rejected or notified when a conflict (such as an already aborted job) occurs. It also adds comprehensive unit tests to verify this behavior.

Error Handling Improvements:

  • Updated JobHandler (src/job/models/jobHandler.ts) to detect ConflictError instances and, in such cases, log a warning and skip both task rejection and job notification, allowing the polling loop to continue without side effects. [1] [2]

Testing Enhancements:

  • Added a unit test in jobHandler.spec.ts to assert that ConflictError does not trigger task rejection or job notification, ensuring correct error handling. [1] [2]
  • Added a unit test in tileMergeTaskManager.spec.ts to verify that a ConflictError during batch publishing (HTTP 409) causes the process to stop immediately and does not continue enqueuing tasks. [1] [2]
Question Answer
Bug fix
New feature
Breaking change
Deprecations
Documentation
Tests added
Chore

Related issues: #XXX , #XXX ...
Closes #XXX ...

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.

1 participant