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

[core] fix local path paring error on ios version lower than 17 #29958

Merged
merged 5 commits into from
Jun 24, 2024

Conversation

Kudo
Copy link
Contributor

@Kudo Kudo commented Jun 23, 2024

Why

possibly fix for #29759

How

on ios < 17, the URL(string:) cannot parse an URL that has spaces and without scheme, it returns nil instead. before SDK 51, we used URL(fileURLWithPath:) instead. that's a regression from #27069.
this pr tries to use the URLComponents(string:) as fallback for ios < 16 which supports RFC 3986 with spaces.

Test Plan

i first tried to add an unit test for FileSystemLegacyUtilities.getPathPermissions. our ios-unit-test ci job is running on ios 16, so there was an expected failed test: https://github.com/expo/expo/actions/runs/9634505045/job/26570225509
then revised the code to use the convertToUrl(string:) to fix the broken test.

Checklist

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

expo-bot commented Jun 23, 2024

The Pull Request introduced fingerprint changes against the base commit: 322106f

Fingerprint diff
[
  {
    "type": "dir",
    "filePath": "../../packages/expo-modules-core",
    "reasons": [
      "expoAutolinkingIos",
      "expoAutolinkingAndroid"
    ],
    "hash": "420731c5f9d0d0adc2818c2b512385ad3f725d72"
  }
]

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 Jun 23, 2024
@Kudo Kudo marked this pull request as ready for review June 24, 2024 05:49
@phemonick
Copy link

phemonick commented Jun 24, 2024

Thanks for the fix, @Kudo , but it doesn't work on Iphone 8, iOS 15.4.

@Kudo
Copy link
Contributor Author

Kudo commented Jun 24, 2024

@phemonick thanks for checking that. could you help to check whether 586c84d works for you?

@Kudo Kudo merged commit 0801eb3 into main Jun 24, 2024
11 checks passed
@Kudo Kudo deleted the @kudo/fix-fs-url-path branch June 24, 2024 14:30
Kudo added a commit that referenced this pull request Jun 24, 2024
# Why

possibly fix for #29759

# How

on ios < 17, the `URL(string:)` cannot parse an URL that has spaces and
without scheme, it returns nil instead. before SDK 51, we used
`URL(fileURLWithPath:)` instead. that's a regression from #27069.
this pr tries to use the `URLComponents(string:)` as fallback for ios <
16 which supports RFC 3986 with spaces.

(cherry picked from commit 0801eb3)
@brentvatne brentvatne added the published Changes from the PR have been published to npm label Jun 27, 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.

None yet

5 participants