klarna / klarna-mobile-sdk

Klarna Mobile SDK for iOS
https://docs.klarna.com/mobile-sdk/ios/
Apache License 2.0
29 stars 12 forks source link

[iOS] KlarnaWindow remains key (does not resign) on completion of SDK flow #204

Closed asos-nathanielwalker closed 1 year ago

asos-nathanielwalker commented 1 year ago

Describe the bug After completing the SDK flow, the window used by the SDK does not always resign itself, and remains the keyWindow. This results in apparent "freezing" of the app due to user interaction being blocked for the merchant's own window.

To Reproduce Steps to reproduce the behavior:

  1. Testdrive SDK version 2.6.5
  2. Trigger/mock a payment capture failure when completing the SDK payment flow (specifically, a 400 response)
  3. Observe the modal SDK flow dismiss, the Klarna widget fail to load, and sometimes a dimmed view remain, overlaying the screen
  4. Underlying (but visible) merchant view is now unresponsive

Expected behavior On completion of the flow (whether error or success) when the SDK payment flow dismisses, KlarnaWindow should resign its state as the key window, returning control to the merchant's own window.

Screenshots KlarnaWindow_Unresigned KlarnaWindow_ViewHierarchy

Device and version:

Merchant Name ASOS

Impact Level Blocking release

Additional context

asos-nathanielwalker commented 1 year ago

Closing as this seems localised to our complex code structure, and doesn't seem possible to reproduce in a simple environment. Will reopen if we discover more during some follow-up work we have planned.