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

ExistingContactEntity.setPhotoDirect fails when there is no previous photo #289

Closed
reactormonk opened this issue Jul 12, 2023 · 4 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@reactormonk
Copy link

The code in ContactPhoto.kt expects an existing photo, otherwise it'll fail:

https://github.com/vestrel00/contacts-android/blob/main/core/src/main/java/contacts/core/util/ContactPhoto.kt#L381-L387

photoFileId will always be null without an existing photo.

@vestrel00 vestrel00 self-assigned this Jul 12, 2023
@vestrel00 vestrel00 added the bug Something isn't working label Jul 12, 2023
@vestrel00 vestrel00 changed the title setPhotoDirect fails when there is no previous photo ExistingContactEntity.setPhotoDirect fails when there is no previous photo Jul 12, 2023
@vestrel00
Copy link
Owner

vestrel00 commented Jul 12, 2023

Lol. Nice catch! 🤦 It seems like this is regression. I broke this in this commit; 253ced8#r121421415

@vestrel00
Copy link
Owner

Btw, this bug is specific to ExistingContactEntity. It does not apply to ExistingRawContactEntity (RawContactPhoto.kt). So, I updated the issue title to reflect this.

@vestrel00 vestrel00 added this to In progress in Consumer issues Jul 12, 2023
@vestrel00 vestrel00 moved this from In progress to Done in Consumer issues Jul 12, 2023
@vestrel00
Copy link
Owner

vestrel00 commented Jul 12, 2023

@reactormonk, this is fixed in 0.3.1. I will not be releasing it any time soon since I'm waiting to include more issues in that release.

If you must set the photo of an ExistingContactEntity using versions 0.3.0 and lower, use setPhoto in conjunction with the Update API instead of setPhotoDirect. Instructions are at https://vestrel00.github.io/contacts-android/other/get-set-remove-contact-raw-contact-photo/#as-part-of-an-insert-or-update-api-call

Thanks so much for raising this bug! ❤️ 🙏 🙇

@vestrel00
Copy link
Owner

🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥
This is now release in 0.3.1!
🔥 🔥 🔥 🔥 🔥 🔥 🔥 🔥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

No branches or pull requests

2 participants