Improve account sync performance, handle concurrent market data syncing #2236

Merged
zachgoll merged 30 commits from zachgoll/plaid-domain-improvements into main 2025-05-15 22:19:57 +08:00
zachgoll commented 2025-05-12 22:42:16 +08:00 (Migrated from github.com)

The major goal of this PR is twofold:

  1. Offload market data syncing to a daily cron to reduce the number of contentious upserts happening during account syncs
  2. Improve the overall sync process and UI states

Sync UI states

We have removed the manual "sync" button on each account because with the right orchestration of syncs, these should never be needed. There are 3 major sync types:

  • Family sync
  • PlaidItem sync
  • Account sync

And there are a few important sync triggers:

Event Triggers
Add account Sync account
Add PlaidItem Sync item, all child accounts
Update an account entry Sync account
Daily auto-sync Sync family

Previously, the UI states for these was a bit scattered. This PR introduces some more granular UI updates to avoid disturbing the user with unnecessary sync refreshes.

  • Account Sync
    • Start
      • Sidebar shows account loading
      • Account graph shows loading
    • End
      • Sidebar stops loading
      • Account graph refreshes
  • PlaidItem Sync
    • Start
      • Sidebar shows all Plaid accounts loading
      • All Plaid account charts show as loading
    • End
      • Sidebar accounts stop loading 1 by 1 as they finish syncing
      • All Plaid account charts refresh 1 by 1 as they finish syncing
  • Family Sync
    • Start
      • Net worth graph loads
      • Balance sheet on dashboard shows loading states
    • End
      • Net worth graph refreshes
      • Balance sheet shows
      • Sidebar stops loading
The major goal of this PR is twofold: 1. Offload market data syncing to a daily cron to reduce the number of contentious upserts happening during account syncs 2. Improve the overall sync process and UI states **Sync UI states** We have removed the manual "sync" button on each account because with the right orchestration of syncs, these should never be needed. There are 3 major sync types: - Family sync - PlaidItem sync - Account sync And there are a few important sync triggers: | Event | Triggers | | --- | ---| | Add account | Sync account | | Add PlaidItem | Sync item, all child accounts | | Update an account entry | Sync account| | Daily auto-sync | Sync family | Previously, the UI states for these was a bit scattered. This PR introduces some more granular UI updates to avoid disturbing the user with unnecessary sync refreshes. - Account Sync - Start - Sidebar shows account loading - Account graph shows loading - End - Sidebar stops loading - Account graph refreshes - PlaidItem Sync - Start - Sidebar shows all Plaid accounts loading - All Plaid account charts show as loading - End - Sidebar accounts stop loading 1 by 1 as they finish syncing - All Plaid account charts refresh 1 by 1 as they finish syncing - Family Sync - Start - Net worth graph loads - Balance sheet on dashboard shows loading states - End - Net worth graph refreshes - Balance sheet shows - Sidebar stops loading
Sign in to join this conversation.