LockdownModeMonitor.presentSheetIfNeeded consumes its one-shot flags before it attempts the presentation, so a presentation that fails silently costs the user the warning for the rest of that editor session.
Detail
ios/Sources/GutenbergKit/Sources/Services/LockdownModeMonitor.swift:148-150 sets hasShownSheet = true and shouldShowSheet = false, and only then calls presentingViewController.present(hostingController, animated: true) at :176. Nothing re-checks whether the presentation actually happened — present(_:animated:) is a no-op when the presenter is already presenting something.
Recovery is closed off too. handleWillEnterForeground early-returns at :119 on guard newValue != self.isLockdownModeEnabled, so while Lockdown Mode stays enabled the value never changes and resetForForegroundCheck() (:95) is unreachable. detectLockdownMode only re-arms shouldShowSheet on a disabled → enabled transition with !hasShownSheet (:79-80).
How it bites
The editor finishes loading while it is already presenting something — a sheet the user opened, or a host-presented modal. didLoadEditor() (EditorViewController.swift:889) calls presentSheetIfNeeded at :908, the flags are consumed, the present silently does nothing, and the Lockdown Mode user never sees the explanation for why the editor may misbehave.
Scoped to that editor instance — lockdownModeMonitor is constructed per editor (EditorViewController.swift:229), so the next editor gets a fresh monitor. Not permanent, but the warning is lost for the session it mattered in.
Suggested fix
Set the flags after a confirmed presentation, or guard on presentingViewController.presentedViewController == nil before consuming them.
Found while reviewing #651. Pre-existing; not introduced there.
LockdownModeMonitor.presentSheetIfNeededconsumes its one-shot flags before it attempts the presentation, so a presentation that fails silently costs the user the warning for the rest of that editor session.Detail
ios/Sources/GutenbergKit/Sources/Services/LockdownModeMonitor.swift:148-150setshasShownSheet = trueandshouldShowSheet = false, and only then callspresentingViewController.present(hostingController, animated: true)at:176. Nothing re-checks whether the presentation actually happened —present(_:animated:)is a no-op when the presenter is already presenting something.Recovery is closed off too.
handleWillEnterForegroundearly-returns at:119onguard newValue != self.isLockdownModeEnabled, so while Lockdown Mode stays enabled the value never changes andresetForForegroundCheck()(:95) is unreachable.detectLockdownModeonly re-armsshouldShowSheeton a disabled → enabled transition with!hasShownSheet(:79-80).How it bites
The editor finishes loading while it is already presenting something — a sheet the user opened, or a host-presented modal.
didLoadEditor()(EditorViewController.swift:889) callspresentSheetIfNeededat:908, the flags are consumed, thepresentsilently does nothing, and the Lockdown Mode user never sees the explanation for why the editor may misbehave.Scoped to that editor instance —
lockdownModeMonitoris constructed per editor (EditorViewController.swift:229), so the next editor gets a fresh monitor. Not permanent, but the warning is lost for the session it mattered in.Suggested fix
Set the flags after a confirmed presentation, or guard on
presentingViewController.presentedViewController == nilbefore consuming them.Found while reviewing #651. Pre-existing; not introduced there.