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

iOS getById do not return thumbnailPath while getAll does #719

Closed
dprevost-LMI opened this issue Sep 27, 2023 · 11 comments
Closed

iOS getById do not return thumbnailPath while getAll does #719

dprevost-LMI opened this issue Sep 27, 2023 · 11 comments

Comments

@dprevost-LMI
Copy link
Contributor

dprevost-LMI commented Sep 27, 2023

As shown below, the getAll returns all the contacts with the thumbnailPath while the getById does not. And this is only for iOS.
image

I tried to change the getContactById method in /RCTContacts.m and use withThumbnails:true (See here and here, but it returned an error.

I did not dig deeper into iOS to understand why, but is this something that could be fixed?

Meanwhile, as a workaround, when doing getById on iOS, I use getPhotoForId when hasThumbnail is true.

@dprevost-LMI
Copy link
Contributor Author

dprevost-LMI commented Sep 27, 2023

FYI: When trying to pass use withThumbnails:true in getContactById, I had the below error.

Exception 'A property was not requested when contact was fetched.' was thrown while invoking getContactById on target Contacts with params (
    "105ECC31-5E65-495E-AAB4-61CFAC933A26:ABPerson",
    57060,
    57061
)
callstack: (
	0   CoreFoundation                      0x0000000196604cc0 A900B459-0127-379E-9CBA-0EAB9C5D559F + 40128
	1   libobjc.A.dylib                     0x000000018f6a43d0 objc_exception_throw + 60
	2   CoreFoundation                      0x00000001966f2224 A900B459-0127-379E-9CBA-0EAB9C5D559F + 1012260
	3   Contacts                            0x00000001a21ce19c DC04FB9D-0749-3FDA-BA32-43A8ED44FA3A + 119196
	4   app                         0x0000000105ecbbf4 -[RCTContacts getFilePathForThumbnailImage:recordID:] + 120
	5   app                         0x0000000105ecb940 -[RCTContacts contactToDictionary:withThumbnails:] + 5392
	6   app                         0x0000000105ecc8ec -[RCTContacts getContact:addressBook:withThumbnails:] + 592
	7   app                         0x0000000105ecc574 -[RCTContacts getContactById:resolver:rejecter:] + 480
	8   CoreFoundation                      0x000000019666dc04 A900B459-0127-379E-9CBA-0EAB9C5D559F + 470020
	9   CoreFoundation                      0x000000019661bcb4 A900B459-0127-379E-9CBA-0EAB9C5D559F + 134324
	10  CoreFoundation                      0x000000019661b6cc A900B459-0127-379E-9CBA-0EAB9C5D559F + 132812
	11  app                         0x000000010594b620 -[RCTModuleMethod invokeWithBridge:module:arguments:] + 1744
	12  app                         0x000000010594f464 _ZN8facebook5reactL11invokeInnerEP9RCTBridgeP13RCTModuleDatajRKN5folly7dynamicEiN12_GLOBAL__N_117SchedulingContextE + 1544
	13  app                         0x000000010594ec80 _ZZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEiENK3$_0clEv + 144
	14  app                         0x000000010594ebe4 ___ZN8facebook5react15RCTNativeModule6invokeEjON5folly7dynamicEi_block_invoke + 28
	15  libdispatch.dylib                   0x000000019daca320 5D16936B-4E4C-3276-BA7A-69C9BC760ABA + 8992
	16  libdispatch.dylib                   0x000000019dacbeac 5D16936B-4E4C-3276-BA7A-69C9BC760ABA + 16044
	17  libdispatch.dylib                   0x000000019dad3534 5D16936B-4E4C-3276-BA7A-69C9BC760ABA + 46388
	18  libdispatch.dylib                   0x000000019dad40a4 5D16936B-4E4C-3276-BA7A-69C9BC760ABA + 49316
	19  libdispatch.dylib                   0x000000019dadecdc 5D16936B-4E4C-3276-BA7A-69C9BC760ABA + 93404
	20  libsystem_pthread.dylib             0x00000001f6439ddc _pthread_wqthread + 288
	21  libsystem_pthread.dylib             0x00000001f6439b7c start_wqthread + 8
)

RCTFatal
facebook::react::invokeInner(RCTBridge*, RCTModuleData*, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext)
facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)::$_0::operator()() const
invocation function for block in facebook::react::RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int)
5D16936B-4E4C-3276-BA7A-69C9BC760ABA
5D16936B-4E4C-3276-BA7A-69C9BC760ABA
5D16936B-4E4C-3276-BA7A-69C9BC760ABA
5D16936B-4E4C-3276-BA7A-69C9BC760ABA
5D16936B-4E4C-3276-BA7A-69C9BC760ABA
_pthread_wqthread
start_wqthread`

@morenoh149
Copy link
Owner

not sure. Does it work on android?

@dprevost-LMI
Copy link
Contributor Author

It does; I did not have to apply the same fix on Android. Do you need more data?

@morenoh149
Copy link
Owner

That is a hint, the issue is only on ios.

Copy link

This issue is stale, please provide more information about the status

@dprevost-LMI
Copy link
Contributor Author

dprevost-LMI commented Dec 18, 2023

Status: Android provides the thumbnailPath, while iOS does not for the getByID. iOS should be fixed to have the same behaviour

@dprevost-LMI
Copy link
Contributor Author

What must I do to keep this open since there was activity and it is a valid bug?

@morenoh149
Copy link
Owner

@dprevost-LMI comment

@morenoh149 morenoh149 reopened this Jan 24, 2024
@dprevost-LMI
Copy link
Contributor Author

🤔

@morenoh149 morenoh149 reopened this Feb 27, 2024
@dprevost-LMI
Copy link
Contributor Author

Is there any reason to close those automatically while they are real issues?

@morenoh149
Copy link
Owner

I don't think it makes sense to keep them open unless someone is working on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants