Private
Public Access
1
0

Add Re-sync button for SimpleFIN connections

Resets LastSyncAt on all linked accounts so the next sync
re-fetches the full 90-day transaction window. Duplicate
detection prevents re-importing existing transactions.

- POST /api/bank-sync/connections/{id}/reset-sync endpoint
- Re-sync button shown only on SimpleFIN connection cards

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Catherine Renelle
2026-02-09 19:29:15 -05:00
parent 8b2f5aad56
commit 5811588698
5 changed files with 53 additions and 0 deletions
+3
View File
@@ -46,6 +46,9 @@ export const bankSyncApi = {
updateLinkedAccount: (linkedAccountId: string, data: { accountId: string | null; isEnabled: boolean }) =>
api.put<LinkedAccountInfo>(`/bank-sync/linked-accounts/${linkedAccountId}`, data),
resetSync: (connectionId: string) =>
api.post(`/bank-sync/connections/${connectionId}/reset-sync`),
syncNow: (connectionId: string) =>
api.post(`/bank-sync/connections/${connectionId}/sync-now`),
@@ -184,6 +184,16 @@
>
Sync Now
</v-btn>
<v-btn
v-if="conn.provider === 'SimpleFIN'"
variant="tonal"
color="secondary"
prepend-icon="mdi-refresh"
:loading="resyncingConnections[conn.id]"
@click="resyncFromScratch(conn)"
>
Re-sync
</v-btn>
<v-btn
variant="tonal"
:color="conn.isActive ? 'warning' : 'success'"
@@ -530,6 +540,7 @@ const connections = ref<SyncConnection[]>([])
const accounts = ref<Account[]>([])
const syncIntervals = reactive<Record<string, number>>({})
const syncingConnections = reactive<Record<string, boolean>>({})
const resyncingConnections = reactive<Record<string, boolean>>({})
// Plaid credentials
const plaidCredentials = ref<PlaidCredentials>({ isConfigured: false, environment: 'sandbox' })
@@ -814,6 +825,20 @@ async function syncNow(conn: SyncConnection) {
}
}
async function resyncFromScratch(conn: SyncConnection) {
resyncingConnections[conn.id] = true
try {
await bankSyncApi.resetSync(conn.id)
await bankSyncApi.syncNow(conn.id)
syncingConnections[conn.id] = true
} catch (err: any) {
errorMessage.value = err.response?.data?.error || 'Re-sync failed'
showError.value = true
} finally {
resyncingConnections[conn.id] = false
}
}
// Handle sync results via SignalR notification
const { notifications } = useNotifications()
watch(notifications, (notifs) => {