diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 13:37:26 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-08-27 13:37:26 +0200 |
| commit | abbbf17bcfe6dfa663b7019c4892db09e27b3808 (patch) | |
| tree | 483968e14d6e853aeb909724e7d60998f3d2a4b2 /web/frontend | |
| parent | 6ec883a7fd40a14f2882076bd1a377bbbd0438ad (diff) | |
Resync Strava title from list payload via Save
Context / Problem: Strava titles can be corrected after import. The sync path only handled new rides; existing rides were marked skipped without checking the cheap list metadata, so corrections like ride #789 stayed stale.
What: In syncRides reuse the existing Save write path for rare title resyncs (pay GPX parse cost) when existing.Name != list.Name; track progress.Updated and surface it in SSE/TS UI; add tests for resync without stream fetch. Remove the now-obsolete TODO.
QA: go test/ vet, tsc, biome/stylelint pass.
Diffstat (limited to 'web/frontend')
| -rw-r--r-- | web/frontend/sync.ts | 6 | ||||
| -rw-r--r-- | web/frontend/types.d.ts | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/web/frontend/sync.ts b/web/frontend/sync.ts index f58d224..9462d52 100644 --- a/web/frontend/sync.ts +++ b/web/frontend/sync.ts @@ -39,7 +39,8 @@ export const mountSync = (): void => { progressBar.max = Math.max(progress.total, 1); progressBar.value = progress.completed; progressCount.textContent = `${progress.completed} / ${progress.total}`; - progressDetails.textContent = `${progress.imported} imported · ${progress.skipped} skipped${formatRateLimit(progress)}`; + const updatedPart = progress.updated ? ` · ${progress.updated} updated` : ""; + progressDetails.textContent = `${progress.imported} imported · ${progress.skipped} skipped${updatedPart}${formatRateLimit(progress)}`; }; const handleEvent = (eventName: string, data: SyncProgress | SyncErrorEvent): boolean => { if (eventName === "progress") { @@ -50,7 +51,8 @@ export const mountSync = (): void => { if (eventName === "complete") { if (!isSyncProgress(data)) throw new Error("Invalid Strava sync completion event"); updateProgress(data); - notice.textContent = `Sync complete: ${data.imported} imported, ${data.skipped} skipped.${formatRateLimit(data)}`; + const updatedPart = data.updated ? `, ${data.updated} updated` : ""; + notice.textContent = `Sync complete: ${data.imported} imported, ${data.skipped} skipped${updatedPart}.${formatRateLimit(data)}`; notice.hidden = false; return true; } diff --git a/web/frontend/types.d.ts b/web/frontend/types.d.ts index 83b3921..d4c4bdf 100644 --- a/web/frontend/types.d.ts +++ b/web/frontend/types.d.ts @@ -144,6 +144,7 @@ export interface SyncProgress { completed: number; imported: number; skipped: number; + updated: number; rateLimit?: RateLimitSnapshot; } |
