Skip to content

Use Pro APIs for dead letter jobs - #713

Draft
bgentry wants to merge 3 commits into
masterfrom
bg/dead-letter-pro-api
Draft

bgentry wants to merge 3 commits into
masterfrom
bg/dead-letter-pro-api

Conversation

@bgentry

@bgentry bgentry commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #711.

Uses the Pro client to list, fetch, and autocomplete dead letter jobs. This removes the UI's duplicate PostgreSQL and SQLite queries, generated code, schema stubs, and driver tests: about 900 fewer lines overall.

The UI controls stay the same. The list endpoint now accepts an after cursor and returns last_cursor, so API callers can fetch jobs beyond the first 200 results. Reads still use the caller's transaction when one is supplied.

The code uses the required client APIs, but they are not available in a published dependency yet: the latest release is still v0.32.0. Keep this as a draft with temporary local replace entries until a release contains those APIs. Then update the four Pro module dependencies and remove their local replacements so CI can resolve them.

brandur and others added 3 commits October 24, 2026 13:02
We got a request in #706 that dead letter jobs should be in the UI, and
that is indeed very true. It's often quite convenient to pull up a UI
and retry a job from there instead of trying to write a one-off script
to do it programmatically.

Here, dead letters are added as a new entry on the left sidebar under
"Queues". I also thought about it integrating it directly into the
"Jobs" pane, but we'd need some new view in there as well, and I don't
think it's any better of a fit.

Like jobs, dead letters get a "filter" textbox at the top that lets you
select a variety of attributes to filter the view underneath in pursuit
of finding specific job(s).

The new pane is shown only for the Pro binary: in OSS, navigation is
hidden, access to the pane is blocked, and the API endpoints aren't
mounted.

Fixes #706.
Reuse the Jobs layouts for consistent dead letter list and detail pages,
with resilient filters, refresh errors, and not-found states. Show newest
dead letters first, use primary-key ID lookups, and align query validation
and autocomplete across Postgres and SQLite. Cancel superseded search
suggestions and share common UI components.
The dead letter handlers select a separate UI driver to query tables
owned by Pro. This duplicates the query code and its database tests.

Use the Pro client's listing, get, and autocomplete methods, and remove
the UI queries, generated code, schema stubs, and driver tests. Use the
transactional methods when the handler has a caller-supplied transaction
so it can still read uncommitted jobs.

Keep the existing filters and response fields. Accept an after cursor and
return the next cursor so API callers can continue beyond 200 results.
Cover cursor requests, transaction visibility, and text byte limits.

Use temporary local module replacements until a released dependency
contains the required APIs. This branch remains a draft until those
replacements can be removed.
@bgentry
bgentry force-pushed the bg/dead-letter-pro-api branch from 7b4d4aa to 9c9d826 Compare October 24, 2026 20:06
@brandur

brandur commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

Sweet. Thoughts on getting this shipped after the feature goes out? Seems like something that's easily stackable post-release.

@bgentry

bgentry commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

Thoughts on getting this shipped after the feature goes out? Seems like something that's easily stackable post-release.

Yeah up to you per #711 (review), we are probably due for releases of everything anyway.

Base automatically changed from brandur-dead-letters-in-ui to master October 24, 2026 23:54
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