Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Crash when opening the rewards panel the first time in a fresh install #8109

Closed
kylehickinson opened this issue Sep 20, 2023 · 1 comment · Fixed by #8110
Closed

Crash when opening the rewards panel the first time in a fresh install #8109

kylehickinson opened this issue Sep 20, 2023 · 1 comment · Fixed by #8110

Comments

@kylehickinson
Copy link
Collaborator

Description:

In 1.59.x there is a crash when you open the rewards panel if it was never turned on in prior installations

Steps to Reproduce

  1. Fresh install
  2. Open rewards panel (ignore onboarding prompt)
@kylehickinson kylehickinson added this to the 1.59 milestone Sep 20, 2023
@kylehickinson kylehickinson self-assigned this Sep 20, 2023
kylehickinson added a commit that referenced this issue Sep 20, 2023
Calling rewards engine APIs before the engine has been initialized can cause a crash because the `WhenReady` method used inside `RewardsEngineImpl` will queue up what is assumed a `SingleThreadedTaskRunner`. This is not the case for iOS which uses a standard sequenced task runner.

This call to fetch promotions happens when showing the rewards panel but the rewards engine may not be initialized until the panel is shown (a sec/privacy requirement to not make API calls to rewards services until a user interacts with the feature), so it was being scheduled instead of executing immediately, thus hitting the threading issue on the brave-core side
kylehickinson added a commit that referenced this issue Sep 20, 2023
…ces (#8110)

Calling rewards engine APIs before the engine has been initialized can cause a crash because the `WhenReady` method used inside `RewardsEngineImpl` will queue up what is assumed a `SingleThreadedTaskRunner`. This is not the case for iOS which uses a standard sequenced task runner.

This call to fetch promotions happens when showing the rewards panel but the rewards engine may not be initialized until the panel is shown (a sec/privacy requirement to not make API calls to rewards services until a user interacts with the feature), so it was being scheduled instead of executing immediately, thus hitting the threading issue on the brave-core side
@Uni-verse
Copy link
Contributor

Verified on iPhone 12 & iPad (7th Gen) running iOS 17.0.3 & iPadOS 17.0 respectively using version 1.60 (23.11.7.17)

Example Example
IMG_5253 IMG_1246

arthuredelstein pushed a commit to brave/brave-core that referenced this issue Feb 13, 2024
…d rewards services (brave/brave-ios#8110)

Calling rewards engine APIs before the engine has been initialized can cause a crash because the `WhenReady` method used inside `RewardsEngineImpl` will queue up what is assumed a `SingleThreadedTaskRunner`. This is not the case for iOS which uses a standard sequenced task runner.

This call to fetch promotions happens when showing the rewards panel but the rewards engine may not be initialized until the panel is shown (a sec/privacy requirement to not make API calls to rewards services until a user interacts with the feature), so it was being scheduled instead of executing immediately, thus hitting the threading issue on the brave-core side
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.