Replace the invalid notIn filter in Fathom media reconciliation

Merged
EH
2d ago
+95-13

The daily Fathom media reconciliation has failed on every run since #25434. On prod it accounts for 624 of the 647 failed Fathom runs over the last 7 days, across all 26 workspaces that run it (1.0.1 and 1.1.0), which put the app's failed-run rate at 52%.

Filter

  • Record filters have no notIn operator, so the server rejected the query with Operator "notIn" is not valid for field "connectedAccountId" of type TEXT. The disconnected-account clause is now not: { connectedAccountId: { in: activeConnectedAccountIds } }, nested inside the fathomRecordingImports relation filter so it keeps its meaning: some import belongs to an account that is no longer connected.
  • An empty in renders IN (), which Postgres rejects. With no active connection every import with an account counts as disconnected, so only connectedAccountId is NOT_NULL stays.

Validation

  • New stale-media-imports.integration-test.ts runs findStaleFathomMediaImports against a real server with no account connected, another account connected, and the import's own account connected.
  • yarn typecheck, yarn lint, yarn test:unit (211 passed).
  • Integration suite not run locally; CI runs it.