diff --git a/src/lib/hooks/useOTAUpdates.test.ts b/src/lib/hooks/useOTAUpdates.test.ts index 1b5ca63214..d174182a33 100644 --- a/src/lib/hooks/useOTAUpdates.test.ts +++ b/src/lib/hooks/useOTAUpdates.test.ts @@ -185,11 +185,11 @@ describe('useOTAUpdateRecovery', () => { ) }) - it('silently clears the marker when the attempted OTA launched', () => { + it('recognizes a launched OTA when the update ID casing differs', () => { jest.mocked(device.get).mockReturnValue({ attemptedAt: Date.now(), channel: 'pull-request-123', - updateId: currentUpdate.updateId, + updateId: currentUpdate.updateId.toUpperCase(), }) renderHook(() => useOTAUpdateRecovery()) diff --git a/src/lib/hooks/useOTAUpdates.ts b/src/lib/hooks/useOTAUpdates.ts index 97f30eb81f..a7e043aeb2 100644 --- a/src/lib/hooks/useOTAUpdates.ts +++ b/src/lib/hooks/useOTAUpdates.ts @@ -262,7 +262,12 @@ export function useOTAUpdateRecovery() { if (!pendingUpdate || !currentlyRunning) return device.remove(['pendingOTAUpdate']) - if (pendingUpdate.updateId === currentlyRunning.updateId) return + if ( + pendingUpdate.updateId.toLowerCase() === + currentlyRunning.updateId?.toLowerCase() + ) { + return + } // A fallback relaunch is immediate. A stale marker can be left by a // successful runtime-compatible bundle that predates this hook.