fix(flutter): audit bug fixes FR-25941/42/43/44#142
Merged
Conversation
Picks up the July 2026 mobile-SDK audit fixes shipped in the native releases: iOS 1.3.12 (root-VC crash, refresh deadlock/race, passkey login+registration completion, Sentry isolated hub) and Android 1.3.36 (main-thread blocking network, PKCE verifier length, process-death callback, webview-bridge origin gate).
The Android getConstants() map omitted clientId, but Dart's FronteggConstants.fromMap casts map["clientId"] as String (non-nullable), so every Android getConstants() call threw a TypeError wrapped as UnknownException. iOS already returns clientId. - Add clientId to the constants map. - Extract buildFronteggConstants(...) as a pure function over primitives so the key set (which must match the Dart contract) is unit-testable without mocking the final FronteggInnerStorage class. - Remove the stale template FronteggFlutterPluginTest (referenced a removed plugin.onMethodCall / getPlatformVersion — never compiled, so the Android unit tests weren't runnable). Test: FronteggConstantsTest asserts the map contains clientId (RED before, GREEN after).
…943)
Eight activity-dependent methods (login, loginWithPasskeys, registerPasskeys,
stepUp, directLoginAction, directLogin, socialLogin, customSocialLogin) used
activityProvider.getActivity()?.let { } with no else branch. When no Activity
is attached (backgrounded app / config-change window) result was never invoked,
so the Dart Future hung forever with no error.
Route all eight through a shared withActivityOrError(...) guard that completes
result with a 'frontegg.error' when getActivity() is null (mirrors what
openAdminPortal already did). The guard is a top-level function so it's
unit-testable without constructing the handler (Context/Activity can't be
mocked in this toolchain).
Also removes the stale non-compiling FronteggFlutterPluginTest template.
Test: NoActivityHangTest (RED before, GREEN after).
…R-25942)
Android login/directLoginAction native callbacks are ((Exception?) -> Unit)?
and iOS login/directLoginAction/logout/switchTenant use Result callbacks, but
the plugin ignored the error and always called result.success(null). A cancelled
or failed authentication therefore surfaced to Dart as success.
- Android: add top-level completeAuthResult(error, result, onSuccess) that routes
a non-null error through result.error(...) (FronteggException message as code,
else "unknown"); wire login, directLoginAction, socialLogin fallback and
customSocialLogin through it. logout ((): Unit) and switchTenant ((Boolean))
already have no error / are handled. Unit-tested via AuthResultPropagationTest.
- iOS: replace the swallowing { _ in result(nil) } completion blocks in
directLoginAction/directLogin/socialLogin/customSocialLogin, logout and
switchTenant with the existing success/failure switch that maps FronteggError
to a FlutterError (matching stepUp/login).
… (FR-25944) forceStateUpdate() never delivered a refreshed state to Flutter, and on iOS it threw MissingPluginException because the method had no handler case. - Android: forceStateUpdate was a comment-only no-op that completed the result without notifying the state listener. Add forceNotifyChanges() to the FronteggStateListener interface and route forceStateUpdate through an extracted, unit-tested top-level forceStateUpdate(listener, result) that calls it. - iOS: add the missing "forceStateUpdate" case and a handler that triggers a one-off state emit via the listener (wired into FronteggMethodCallHandler in register()). - iOS: FronteggStateListenerImpl.subscribe() appended Combine sinks to cancellables without clearing prior ones, so every EventChannel onListen (e.g. hot restart) leaked sinks and fired updateState() once per accumulated sink. Call dispose() at the start of subscribe(). forceNotifyChanges() hops to a background queue before updateState() to avoid the DispatchQueue.main.sync deadlock when invoked from the main-thread method channel. Test: ForceStateUpdateTest (Android, RED->GREEN).
…-clientid' into combine/flutter-audit-bugs
…hang' into combine/flutter-audit-bugs # Conflicts: # android/src/main/kotlin/com/frontegg/flutter/FronteggMethodCallHandler.kt
…s' into combine/flutter-audit-bugs # Conflicts: # android/src/main/kotlin/com/frontegg/flutter/FronteggMethodCallHandler.kt
…into combine/flutter-audit-bugs # Conflicts: # android/src/main/kotlin/com/frontegg/flutter/FronteggMethodCallHandler.kt
This was referenced Jul 23, 2026
raz-shlomo-frontegg
approved these changes
Jul 23, 2026
…bine/flutter-audit-bugs
Collaborator
Author
|
Folded the native SDK bump (was #137) into this PR: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
getConstants()omittedclientId, crashingFronteggConstants.fromMapon every call (FR-25941).login/directLogin/switchTenantreported success on failure or cancel; now reject/propagate the error (iOS + Android) (FR-25942).forceStateUpdate()never emitted state (Android no-op / iOSMissingPluginException); also fixed the iOS Combine listener leak on re-subscribe (FR-25944).1.3.36/ iOS1.3.12.Supersedes #137, #138, #139, #140, #141.