Stabilisation: login loop fixed, capture race fixed, dead code removed
This release closed out the stabilisation pass before build-out begins. Nothing new shipped. Everything that was already in the extension got verified, fixed, or cleaned up.
The biggest fix was the login loop. When a diagnosis returned an auth error, the extension was routing to the login screen without clearing the capture from storage. On the next open, the capture was still there, the user clicked Diagnose again, hit the same error, and ended up in a loop. The fix adds a storage clear at both points in the code where auth failure can happen.
The Vision Capture race was also confirmed and fixed. The popup was opening and polling for capture data before content.js had finished writing it. The polling interval was widened from 200ms to 350ms, giving the write enough time to land.
Several pieces of dead code were removed: a side-panel block that was never reachable, an unused auth message handler in the service worker, and 2 popup functions that referenced HTML elements that don’t exist.
What it answers
– why does lens keep taking me back to the login screen
– why does lens show the idle state instead of my capture
– what was in the lens stabilisation pass
– why does lens not show my element after capturing it
– what dead code was removed from lens
Why we built it
The login loop was a direct user report. The Vision Capture race was confirmed live via diagnostics logs. Neither could go into build-out unfixed.
- Force Auth Failure button added to the diagnostics page to support auth debugging: clears the refresh token with a confirmation dialog
- Login loop fixed: capture keys (ll_capture_ready and ll_capture_result) now cleared before routing to the unauthenticated state on auth_invalid and account_not_found errors
- Login loop fixed on second path: same storage clear added to the no-token-after-retry path in startDiagnosing()
- Vision Capture race fixed: initPopup polling interval widened from 200ms to 350ms, extending the total window from 1,200ms to 2,100ms
- Dead side-panel block removed from initPopup(): _tabId, _isSidePanelActive, _allStorage full-storage read, _spFallback, and the unreachable isSidePanelActive block
- Dead REFRESH_AUTH_TOKEN message handler removed from service-worker.js: nothing in the codebase was sending this message
- Dead popup functions removed: getActiveTab (defined, never called) and renderAlternativeProblemOptions (referenced HTML elements that don't exist in popup.html)