-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Conversation
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() |
There was a problem hiding this comment.
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 Record
s?
@@ -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(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"approximateLocation": exportLocation(location: collection.approximateLocation) ?? NSNull(), | |
"approximateLocation": exportLocation(location: collection.approximateLocation) ?? nil, |
Any reason we wouldn't use nil
here?
Co-authored-by: Expo Bot <34669131+expo-bot@users.noreply.github.com>
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
npx expo prebuild
& EAS Build (eg: updated a module plugin).