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

[media-library]: include more error information in native rejections #30504

Merged
merged 4 commits into from
Jul 28, 2024

Conversation

vonovak
Copy link
Contributor

@vonovak vonovak commented Jul 18, 2024

Why

closes #30441

How

the native module rejections include the error message from the native error

Test Plan

#30441 mentions issues with deleting assets. Unfortunately I wasn't able to get the delete method to report an error (I tried deleting already deleted asset, or provide invalid data), but since it compiles and tests in bare expo pass I believe it's safe.

Checklist

Copy link

linear bot commented Jul 18, 2024

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

expo-bot commented Jul 18, 2024

The Pull Request introduced fingerprint changes against the base commit: 7c66ec3

Fingerprint diff
[
  {
    "op": "changed",
    "source": {
      "type": "dir",
      "filePath": "../../packages/expo-media-library/ios",
      "reasons": [
        "expoAutolinkingIos"
      ],
      "hash": "b8a18d9dfba4a6695c0e67b3defb9f41b78c8fc9"
    }
  }
]

Generated by PR labeler 🤖

@@ -55,7 +55,7 @@ func stringifyAlbumType(type: PHAssetCollectionType) -> String {

func exportAssetInfo(asset: PHAsset) -> [String: Any?]? {
if var assetDict = exportAsset(asset: asset) {
assetDict["location"] = exportLocation(location: asset.location)
assetDict["location"] = exportLocation(location: asset.location) ?? NSNull()
Copy link
Contributor Author

@vonovak vonovak Jul 18, 2024

Choose a reason for hiding this comment

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

this assertion was failing - the location entry wasn't present in the response. now it's null.

Maybe we should rewrite this to use expo module Records?

@@ -218,7 +218,7 @@ func exportCollection(_ collection: PHAssetCollection?, folderName: String? = ni
"assetCount": assetCountOfCollection(collection),
"startTime": exportDate(collection.startDate),
"endTime": exportDate(collection.endDate),
"approximateLocation": exportLocation(location: collection.approximateLocation),
"approximateLocation": exportLocation(location: collection.approximateLocation) ?? NSNull(),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"approximateLocation": exportLocation(location: collection.approximateLocation) ?? NSNull(),
"approximateLocation": exportLocation(location: collection.approximateLocation) ?? nil,

Any reason we wouldn't use nil here?

vonovak and others added 3 commits July 26, 2024 21:48
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
@expo-bot expo-bot added bot: passed checks ExpoBot has nothing to complain about and removed bot: suggestions ExpoBot has some suggestions labels Jul 27, 2024
@vonovak vonovak merged commit bf98c05 into main Jul 28, 2024
17 of 18 checks passed
@vonovak vonovak deleted the @vonovak/eng-12825 branch July 28, 2024 04:18
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

expo-media-library is throwing an error without any useful details
4 participants