Skip to main content
All Docs
FeaturesMaking Tax DigitalUpdated March 26, 2026

Bug Fix: Inngest Quarterly Submit Was Silently Skipping Uncategorised Transactions

Bug Fix: Inngest Quarterly Submit Was Silently Skipping Uncategorised Transactions

Release: v1.0.456
Severity: High
Affected component: Inngest background job — hmrc/quarterly-submit
Status: ✅ Fixed


What happened

When a quarterly HMRC submission is triggered via the Inngest event pipeline, step 1b (check-uncategorised) is responsible for blocking the submission if any transactions in the quarter have not been assigned an HMRC category. This is a critical safety gate — submitting uncategorised data to HMRC produces an invalid return.

The guard query read:

// Before fix — incomplete
where: isNull(transactions.hmrcCategory)

This only caught transactions where hmrcCategory is database-NULL. It did not catch transactions where hmrcCategory is set to the string 'unused'.

Why 'unused' matters

The platform uses two sentinel states to represent "not yet categorised":

ValueSource
NULLDefault for transactions imported from bank feeds
'unused'Assigned to manually-created transactions and those imported via AgentOS

Both sentinels mean the same thing from a compliance perspective: the transaction has no valid HMRC category and must not be submitted. The tRPC submission.submit router already understood this and checked both:

// tRPC router — correct (unchanged)
where: or(
  isNull(transactions.hmrcCategory),
  eq(transactions.hmrcCategory, 'unused')
)

The Inngest function, however, only checked isNull, making it inconsistent with the router.

Reproduction steps

  1. Create a manual transaction (or import one via AgentOS) and leave its HMRC category unset — it will be stored with hmrcCategory = 'unused'.
  2. Compute the quarter that includes that transaction.
  3. Trigger the quarterly submit via the Inngest event pipeline.
  4. Before this fix: the check-uncategorised guard passes, and the submission proceeds to HMRC with the uncategorised transaction included.
  5. After this fix: the guard correctly blocks the submission.

The fix

The Drizzle query in src/inngest/functions/hmrc-quarterly-submit.ts step check-uncategorised was updated to mirror the tRPC router:

// After fix — consistent with tRPC router
where: or(
  isNull(transactions.hmrcCategory),
  eq(transactions.hmrcCategory, 'unused')
)

No changes to the database schema, tRPC router, or any other submission logic were required.

Who was affected

  • Users whose quarterly submissions are processed via the Inngest background job and who have manual or AgentOS-imported transactions left in the 'unused' category state.
  • Users who submitted exclusively through the tRPC route (submission.submit) were not affected — that path already applied both checks.

What you should do

If you made a quarterly submission through the Inngest pipeline and had manually-created or AgentOS-imported transactions that were not fully categorised at the time:

  1. Review the transactions included in that submission period.
  2. Assign correct HMRC categories to any transactions still showing as uncategorised or 'unused'.
  3. Check with HMRC or your accountant whether an amended submission is required.

Going forward, the Inngest guard will correctly block any submission that contains uncategorised transactions, regardless of which sentinel value they carry.