Skip to content

fix(jobs): queue follow-up jobs even when the client hangs up - #222

Merged
ndbroadbent merged 1 commit into
mainfrom
nathan/job-inserts-survive-disconnect
Nov 12, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
nathan/job-inserts-survive-disconnect

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

A deploy approval request queues its Slack notification after the record is saved, using the request's context. If
the client disconnected first, the context was cancelled, River's insert failed with "context canceled" and nobody
was told about the request, though the record and its audit entry were saved.

jobs.Client.InsertAfterWrite keeps the request's values but not its cancellation, with its own 10-second timeout. It
queues the job of every write that's already committed:

  • the Slack notification and the GitHub PR comment for a new deploy approval request
  • the CircleCI approval job when a request is approved
  • the welcome and admin emails for a new user
  • the audit event notification, which already ignored cancellation through its own timeout

A deploy approval request queues its Slack notification after the record is saved, using the request's context. If
the client disconnected first, the context was cancelled, River's insert failed with "context canceled" and nobody
was told about the request, though the record and its audit entry were saved.

jobs.Client.InsertAfterWrite keeps the request's values but not its cancellation, with its own 10-second timeout. It
queues the job of every write that's already committed:

- the Slack notification and the GitHub PR comment for a new deploy approval request
- the CircleCI approval job when a request is approved
- the welcome and admin emails for a new user
- the audit event notification, which already ignored cancellation through its own timeout
@deepsource-io

deepsource-io Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in d197d0e...61bb5a6 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
JavaScript Nov 11, 2026 11:01p.m. Review ↗
Go Nov 11, 2026 11:01p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@ndbroadbent
ndbroadbent merged commit b987832 into main Nov 12, 2026
11 checks passed
@ndbroadbent
ndbroadbent deleted the nathan/job-inserts-survive-disconnect branch November 12, 2026 02:18
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