Skip to content

Open-source gym & body-weight tracker, now in the App Store (iPhone + Apple Watch) and as an Android APK. Plan routines, log workouts, see which muscles are trained, import from Strong/Hevy/FitNotes. Self-host it or use it on the phone alone.

Settings: Try again on the sign-out sheet offers the refused photos and videos again too

Duarte Santosef9a4af6ceb5
diff --git a/frontend/src/components/ServerSync.jsx b/frontend/src/components/ServerSync.jsx
index bb07833a0..9d3988519 100644
--- a/frontend/src/components/ServerSync.jsx
+++ b/frontend/src/components/ServerSync.jsx
@@ -153,7 +153,10 @@ export function OwedSheet({ kind, count: count0, media: media0 = 0, exportBackup
const retry = async () => {
setBusy(true)
await useStore.getState().syncNow()
- await syncMedia({ force: true })
+ // Past the refusals too, as the Settings row does: a proxy's limit or the server's caps may
+ // have been fixed since, and a file refused for good would otherwise hold this sheet open on
+ // every try.
+ await syncMedia({ force: true, retryRejected: true })
const r = await attempt(kind)
setBusy(false)
if (!r) return
diff --git a/frontend/src/components/ServerSync.media.test.jsx b/frontend/src/components/ServerSync.media.test.jsx
index 9e89f25ab..27aa2d2cd 100644
--- a/frontend/src/components/ServerSync.media.test.jsx
+++ b/frontend/src/components/ServerSync.media.test.jsx
@@ -61,12 +61,12 @@ describe('OwedSheet with photos and videos waiting', () => {
expect(host.textContent).toContain('1 photos or videos have not reached your server yet.')
})
- it('Try again sends them too, and the sheet follows the new count', async () => {
+ it('Try again sends them too — the refused ones included — and the sheet follows the new count', async () => {
act(() => root.render(<OwedSheet kind="signout" count={0} media={1} exportBackup={vi.fn()} exportBackupZip={vi.fn()} done={vi.fn()} close={vi.fn()} />))
mocks.signOut = vi.fn(async () => ({ owed: true, count: 0, media: 1 }))
mocks.sync = { status: 'pending' }
await act(async () => { button('Try again').click(); await new Promise(r => setTimeout(r, 0)) })
- expect(mocks.syncMedia).toHaveBeenCalledWith({ force: true })
+ expect(mocks.syncMedia).toHaveBeenCalledWith({ force: true, retryRejected: true })
expect(mocks.signOut).toHaveBeenCalled()
})