Skip to content

fix(fathom): skip getDocument when header cache is missing#4859

Merged
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/fathom-header-guard
Jun 3, 2026
Merged

fix(fathom): skip getDocument when header cache is missing#4859
waleedlatif1 merged 1 commit into
stagingfrom
waleedlatif1/fathom-header-guard

Conversation

@waleedlatif1
Copy link
Copy Markdown
Collaborator

Summary

  • Follow-up to the merged connectors PR (feat(connectors): add 11 knowledge base connectors #4849), addressing a greptile review note on the release PR (v0.6.101: 11 new knowledgebase connectors, slack scopes update, login refinements #4858)
  • Fathom getDocument previously emitted a degraded record when the cached FathomMeetingHeader was missing — 'Untitled Fathom Meeting' title, no sourceUrl, and a timing-less contentHash (fathom:${id}) that would never trigger re-indexing on change
  • Now it returns null (with a warn log) when the header is absent, so an incomplete, un-refreshable record can't pollute the index. In the normal sync flow listDocuments always populates the header cache before getDocument runs, so this only guards the edge case (standalone/retry call with no populated syncContext) — and the meeting is retried on the next sync once the cache is populated

Type of Change

  • Bug fix (hardening)

Testing

Tested manually — type-check clean, lint clean, 100 connector tests pass.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jun 3, 2026 3:05am

Request Review

@cursor
Copy link
Copy Markdown

cursor Bot commented Jun 3, 2026

PR Summary

Low Risk
Small connector hardening with no auth or broad sync-engine changes; only affects an edge case where cache was empty.

Overview
Fathom getDocument no longer builds a document when the per-meeting header is missing from syncContext. It logs a warning and returns null instead of emitting a degraded record (generic title, weak contentHash, missing sourceUrl).

When a header is present, hydrated documents now always use the cached title, sourceUrl, contentHash, and metadata—no optional fallbacks that could diverge from the listing stub.

This guards standalone or retry hydration without a populated cache; normal sync still fills headers in listDocuments first, so meetings can be retried on a later sync.

Reviewed by Cursor Bugbot for commit 41b3413. Configure here.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Jun 3, 2026

Greptile Summary

This fix adds an early-return null guard in getDocument when the FathomMeetingHeader is absent from the syncContext cache, preventing a degraded record (wrong title, no sourceUrl, minimal contentHash) from being written to the index. Once the guard is in place, the optional-chaining fallbacks (?.) on header are removed since header is now proven non-null before use.

  • When readCachedHeader returns undefined, getDocument now returns null with a warn log instead of emitting a stub record whose contentHash (fathom:${id}) would never change and therefore never trigger a re-index.
  • Direct property access (header.title, header.contentHash, header.metadata) replaces optional-chaining; this is type-safe because FathomMeetingHeader declares those three fields as required.

Confidence Score: 5/5

Safe to merge — the change is a targeted null guard that only affects the edge case where getDocument is called without a populated sync context.

The change is small and the logic is straightforward: fetch transcript/summary, then bail out early if the header cache is empty. The FathomMeetingHeader type already declares title, contentHash, and metadata as required, so removing the optional-chaining fallbacks is type-safe. The normal sync flow (listDocuments → getDocument) always populates the cache first, so the null path only fires in standalone/retry scenarios where silently skipping is the correct behavior. No new side effects are introduced.

No files require special attention.

Important Files Changed

Filename Overview
apps/sim/connectors/fathom/fathom.ts Adds a null guard in getDocument that returns null (with a warn log) when the FathomMeetingHeader is missing from the sync-context cache, replacing fallback values that produced stale, un-refreshable index records.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[getDocument called] --> B{externalId present?}
    B -- No --> Z[return null]
    B -- Yes --> C[Fetch transcript]
    C --> D{transcript ok?}
    D -- 404 --> Z
    D -- error --> E[throw → catch → return null]
    D -- ok --> F[Fetch summary optional]
    F --> G{hasTranscript or hasSummary?}
    G -- No --> Z
    G -- Yes --> H[readCachedHeader from syncContext]
    H --> I{header found?}
    I -- No --> J[warn log → return null]
    I -- Yes --> K[formatMeetingContent]
    K --> L{content non-empty?}
    L -- No --> Z
    L -- Yes --> M[return ExternalDocument]
Loading

Reviews (1): Last reviewed commit: "fix(fathom): skip getDocument when heade..." | Re-trigger Greptile

@waleedlatif1 waleedlatif1 merged commit ba2e4cc into staging Jun 3, 2026
14 checks passed
@waleedlatif1 waleedlatif1 deleted the waleedlatif1/fathom-header-guard branch June 3, 2026 03:11
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