Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[asset] fix reentrant promise resolving crash #27672

Merged
merged 2 commits into from
Mar 15, 2024
Merged

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Mar 14, 2024

Why

ios bare-expo release build was crashing because of "Tried to resolve a promise more than once."

How

i think we should have early return after resolving the promise.

Test Plan

  • launch bare-expo release build will not crash

Checklist

@expo-bot expo-bot added the bot: suggestions ExpoBot has some suggestions label Mar 14, 2024
@expo-bot
Copy link
Collaborator

expo-bot commented Mar 14, 2024

The Pull Request introduced fingerprint changes against the base commit: ec64e1a

Fingerprint diff
[
  {
    "type": "dir",
    "filePath": "../../packages/expo-asset/ios",
    "reasons": [
      "expoAutolinkingIos"
    ],
    "hash": "bc2b8da4c5c6f0883232bb4ee0f11806f024b49d"
  }
]

Generated by PR labeler 🤖

@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 14, 2024
@expo-bot expo-bot added bot: suggestions ExpoBot has some suggestions and removed bot: passed checks ExpoBot has nothing to complain about labels Mar 14, 2024
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Mar 15, 2024
@Kudo Kudo marked this pull request as ready for review March 15, 2024 04:57
@Kudo Kudo requested review from aleqsio and removed request for wschurman March 15, 2024 04:57
@@ -20,6 +20,7 @@ public class AssetModule: Module {
AsyncFunction("downloadAsync") { (url: URL, md5Hash: String?, type: String, promise: Promise) in
if url.isFileURL {
promise.resolve(url.standardizedFileURL.absoluteString)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe resolve/reject should have the return type Never so it basically requires to be the last expression within the block? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe resolve/reject should have the return type Never so it basically requires to be the last expression within the block? 🤔

i'll leave it to you and merge the pr first for fixing ci. thanks!

@Kudo Kudo merged commit f9d01d6 into main Mar 15, 2024
24 of 25 checks passed
@Kudo Kudo deleted the @kudo/fix-asset-crash branch March 15, 2024 08:37
Kudo added a commit that referenced this pull request Mar 15, 2024
# Why

investigating test-suite ios failure. this one is a regression from
#27601 and caused `Linking.getInitialURL()` returns null when launching
app with deep links.

# How

pass the launchOptions to the bridge

# Test Plan

- kill bare-expo process and run `xcrun simctl openurl booted
'bareexpo://test-suite/run?tests=Basic'` should go to the basic test
screen
- ci passed especially for test-suite ios
- this pr is stacked on top of #27672 and should work to fix test-suite
marklawlor pushed a commit that referenced this pull request Mar 18, 2024
# Why

ios bare-expo release build was crashing because of "Tried to resolve a
promise more than once."

# How

i think we should have early return after resolving the promise.
marklawlor pushed a commit that referenced this pull request Mar 18, 2024
# Why

investigating test-suite ios failure. this one is a regression from
#27601 and caused `Linking.getInitialURL()` returns null when launching
app with deep links.

# How

pass the launchOptions to the bridge

# Test Plan

- kill bare-expo process and run `xcrun simctl openurl booted
'bareexpo://test-suite/run?tests=Basic'` should go to the basic test
screen
- ci passed especially for test-suite ios
- this pr is stacked on top of #27672 and should work to fix test-suite
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: fingerprint changed bot: passed checks ExpoBot has nothing to complain about published Changes from the PR have been published to npm
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants