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

fix NSInternalInconsistencyException crash #362

Merged
merged 1 commit into from
May 2, 2024
Merged

Conversation

whrlgus
Copy link

@whrlgus whrlgus commented May 1, 2024

I experienced an issue "Invalid batch updates detected", when the main thread was busy working.

The photoLibraryDidChange function would be called multiple times on background thread and changes fetched by old fetchResult caused NSInternalInconsistencyException crash in async main dispatch block.

This change eliminates the possibility that fetched changes will be stale. 😀

@whrlgus
Copy link
Author

whrlgus commented May 1, 2024

reproduce crash:

  1. use sleep function in async main dispatch block to make the process take long for completion
  2. build your app and present a photo picker view
  3. move to album app, delete few photos in your album and take a photo using a camera app
  4. return to your app, then your app will crash

@mikaoj mikaoj merged commit 5925719 into mikaoj:master May 2, 2024
@tuncayforma38 tuncayforma38 mentioned this pull request May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants