Skip to content

Hide 'Last Updated' for offline organizations#1939

Open
jbirdjavi wants to merge 1 commit into
mainfrom
offline-org-hide-last-updated
Open

Hide 'Last Updated' for offline organizations#1939
jbirdjavi wants to merge 1 commit into
mainfrom
offline-org-hide-last-updated

Conversation

@jbirdjavi

Copy link
Copy Markdown
Contributor

Problem

Offline organizations (e.g. "Wycliffe Bible Translators USA") never download data — they only ever receive a manually-uploaded TntConnect DataSync file. But the nightly import job still runs against them and stamps person_organization_accounts.last_download on that no-op run, so Settings → Integrations → Organizations showed a fresh "Last Updated — X hours ago" on cards that had never actually received anything.

For migrated Wycliffe users who hold both an offline "Wycliffe Bible Translators USA" card and the real "Wycliffe USA (DonorHub)" card, this made the offline card look healthy and masked a broken DonorHub sync — the exact confusion reported in HS-1683554 / HS-1686072.

Root cause

In mpdx-api, Person::OrganizationAccount#import_all_data unconditionally writes last_download: Time.current after import_donations, even when the org's import_all is a no-op (OfflineOrg#import_all does nothing). The once-per-day import guard makes the value read as "earlier today," every day. That timestamp is a legitimate operational fact ("the import job last completed") for the code that consumes it, but the UI mislabels it as "Last Updated" for orgs where it means nothing.

Fix

Gate the "Last Updated" row on the org type already computed in the component, matching the existing Sync/Import-button gating a few lines above:

{type !== OrganizationTypesEnum.OFFLINE && lastDownloadedAt && (

"Last Gift Date" still renders for offline orgs — that's the honest signal for a file-import org.

This is deliberately a presentation-layer fix. last_download stays correct as "import job last completed" for the throttle (future_last_download?), fan-out ordering (with_linked_org_accounts), and login queue (queue_imports) that rely on it. A separate backend perf follow-up could stop queuing offline orgs for import at all, but that's out of scope here.

Testing

  • Flipped should render Offline Organization to assert "Last Updated" is absent for an offline org (it previously asserted present — the test encoded the bug).
  • Added an assertion to should render Ministry Account Organization that "Last Updated" is present for a non-offline org (guards against over-gating).
  • All 9 tests in OrganizationAccordion.test.tsx pass; verified red→green and that the change is caught if the gate is wrong in either direction.

🤖 Generated with Claude Code

https://claude.ai/code/session_01HcHZJWUKidBEU4h6s8urtV

Offline orgs never download data, but the nightly import still stamps
person_organization_accounts.last_download on a no-op run, so the
Organizations settings panel advertised a fresh 'Last Updated' time on
cards that had never received anything. This masked dead DonorHub
connections for migrated Wycliffe users, who read the offline card as
healthy.

Gate the 'Last Updated' row on the org type already computed in the
component, matching the existing Sync/Import button gating. 'Last Gift
Date' still renders for offline orgs as the honest signal.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HcHZJWUKidBEU4h6s8urtV
@github-actions

Copy link
Copy Markdown
Contributor

Bundle sizes [mpdx-react]

Compared against ea57016

No significant changes found

@jbirdjavi
jbirdjavi requested a review from canac July 23, 2026 20:22
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