Skip to content

Read the Oban job id without a struct pattern so consumers type-check (2.0.4) - #26

Merged
corepay merged 1 commit into
mainfrom
oban-unsaved-job-2.0.4
Oct 9, 2026
Merged

corepay merged 1 commit into
mainfrom
oban-unsaved-job-2.0.4

Conversation

@palermo-git

Copy link
Copy Markdown
Contributor

Consumers using use AshHooks.Worker got two Dialyzer pattern_match warnings because Oban.Job.t() omits the unsaved uniqueness-conflict case (id nil). The guards now read the id through a helper; outcomes are unchanged. Dialyzer on a compiled consumer worker: 2 warnings before, 0 after. Local gates: format, compile --warnings-as-errors, credo --strict, hex.audit, currency, SQLite 787 passed, PostgreSQL 825 passed at 100.00% coverage, no-optional-deps 755 passed, exact Ash floor, consumer verify, docs, package check.

…check (2.0.4)

Oban returns an unsaved job with id nil on a uniqueness conflict, which
is what the durable-insert retry and the not-persisted refusal handle,
but Oban.Job.t() declares id as pos_integer(). The guards injected by
use AshHooks.Worker matched %Oban.Job{id: nil}, so Dialyzer in every
consumer reported both as unreachable. They now read the id through a
private helper with identical outcomes. The Dialyzer gate covers a
consumer worker compiled from test/support (2 warnings before, 0
after), and real Oban tests on PostgreSQL cover the conflict retry and
the refusal after twenty retries. Ash moves to 3.34.6 and ash_postgres
to 2.14.5 for the currency gate.
@palermo-git
palermo-git requested a review from corepay as a code owner October 9, 2026 17:02
@coderabbitai

coderabbitai Bot commented Oct 9, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd27f0e5-fa39-4618-a35e-02f44e03663d

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@corepay
corepay merged commit 12875de into main Oct 9, 2026
19 checks passed
@corepay
corepay deleted the oban-unsaved-job-2.0.4 branch October 9, 2026 17:38
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