Repository navigation
Description
A delayed cloud-import response can close a newer picker and discard its selection. Suggested severity: P2. This is a follow-up to merged #3984 (17cecce072a57cb8817249a8185c68040d46c030); the pre-merge review remains at #3984 (comment).
Reproduce locally for both OneDrive and Google Drive:
- Start an import and hold its response.
- Dismiss its started toast and picker with Escape, reopen the same provider and check a folder.
- Deliver the old import’s lapsed-grant answer.
Expected: the newer picker and checked selection remain; the completed background request gets one non-disruptive result. Dismissing the picker does not imply cancellation of the server import.
Actual: the newer picker closes, its selection is lost, and the old answer opens Reconnect.
The new handOffInterruptedImport helpers call parent callbacks after their original picker unmounts (google-drive-import-dialog.tsx:196–198, onedrive-import-dialog.tsx:158–160 at reviewed head b589a663e6b1927671c6b953a61b035517dc48ba). The parent callbacks close whichever picker is open now and open Reconnect (documents-action-menu.tsx:152–167). Scope the handoff to the originating interaction; preserve a later picker/selection and once-only reporting. Reuse the existing UI action/dialog lifecycle rather than add another import engine.
Evidence: both cases reproduce through actual Documents menu/pickers/Dialog/action hook/toast in jsdom and real Chromium; substituting only the four UI components from base b9f5a028 makes both pass in both environments. Source was restored byte-for-byte. Action/authorization/configuration answers are synthetic and provider calls inert. Existing focused checks pass 246 tests plus two independent partial-retry controls. Retained Vitest4.1.11/browser4.1.10 mismatch is disclosed; no full-app/provider/backend/a11y certification or production testing is claimed. Owned evidence: /Users/yannick/.codex/notes/tale-manual-cycle-20260929/review-3984/review.md.
Cover stale response after dismiss/reopen, unchanged interaction handoff, provider separation, completed-background once-only result and selection preservation. No new tenant/auth exposure was established in the bounded review. The existing #3921 hidden-search deselection defect has a different synchronous cause.
Activity