Skip to content

fix: build against apalis-core 1.0.0-rc.11 - #118

Closed
iltumio wants to merge 1 commit into
apalis-dev:mainfrom
iltumio:fix/apalis-core-rc11-compat
Closed

iltumio wants to merge 1 commit into
apalis-dev:mainfrom
iltumio:fix/apalis-core-rc11-compat

Conversation

@iltumio

@iltumio iltumio commented Oct 8, 2026

Copy link
Copy Markdown

Description

apalis-postgres 1.0.0-rc.9 requires apalis-core = "^1.0.0-rc.10", which now resolves to rc.11 — and rc.9 does not compile against it:

  • WorkerContext::tasks() is behind apalis-core's task-context feature and returns a Result (keep_alive.rs);
  • WaitForCompletion::wait_for / check_status take &mut self (wait_for.rs).

This bumps apalis-core / apalis-codec (and the apalis / apalis-workflow dev-dependencies) to rc.11, enables task-context so the heartbeat can still list the worker's running tasks, surfaces TaskStateError as a new Error::TaskState variant, and takes &mut self in the two WaitForCompletion methods. No behaviour change.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Refactoring (no functional changes)

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • I have run the existing tests and they pass
  • I have run cargo fmt and cargo clippy

cargo check --all-targets and cargo clippy --all-targets pass with SQLX_OFFLINE=true (the only warnings are the existing ones in examples/basic.rs and examples/unique_jobs.rs). I did not run the database-backed tests.

Checklist

  • My code follows the code style of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Additional Notes

Adding a variant to Error is technically an API addition; the enum is not #[non_exhaustive], so callers that match it exhaustively would need a new arm.

apalis-core rc.11 moved the running-task registry behind its `task-context`
feature (`WorkerContext::tasks` now returns a `Result`) and gave
`WaitForCompletion` a `&mut self` receiver. `^1.0.0-rc.10` resolves to rc.11, so
rc.9 no longer compiles in a fresh resolution.

Enable `task-context` for the heartbeat's task list, surface its error as
`Error::TaskState`, and take `&mut self` in `wait_for` / `check_status`.
@iltumio
iltumio requested a review from geofmureithi as a code owner October 8, 2026 11:31
@geofmureithi

Copy link
Copy Markdown
Member

Thanks for this but task-tracking is an optional feature.
I wish you had created an issue first as I was working on a new release.

Resolved in #119

@iltumio

iltumio commented Oct 8, 2026

Copy link
Copy Markdown
Author

sorry, my bad. I have to put some more guardrails to my agents. Thanks for your help

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