dado3212 / books-annotations

Code for extracting annotations and highlights from the iBooks/Books app on iPhone and iPad
Other
4 stars 1 forks source link

App freezes on MacOS #1

Open g1azunya opened 2 months ago

g1azunya commented 2 months ago

Hi there. The app launches okay and sees the connected device, but freezes right after clicking on it. Both columns are empty, no files initialized. Running on Sonoma 14.5, Air M1. If that helps, the iPhone is accessible via iExplorer without any issue on my machine.

P.S. I really appreciate what you are doing. First the books app stopped showing my highlights made before 2019, and now the Mac app doesn't show any annotations made before altogether. It would be great to recover these.

dado3212 commented 2 months ago

@g1azunya if you press Cmd+Shift+I it will open the Dev Inspector. Under 'Console' are there any errors printed out?

g1azunya commented 2 months ago

Not sure if that's what you've asked me to do (although I dutifully pressed Cmd+Shift+I to no avail), but the macOS native Console.app logs the following errors for upon the launch of your application:

BOOL _NSPersistentUIDeleteItemAtFileURL(NSURL *const __strong) Failed to stat item:

there's also another error in the logs thrown by kernel

Sandbox: logd_helper(387) deny(1) file-read-data /private/var/folders/db/60wfp5bd6rj4qv0pbgcyfxc00000gn/T/AppTranslocation/C8EE11EC-18FD-4206-AE73-97EB06906525/d/Books Annotations.app/Contents/Resources/app/node_modules/@lwahonen/ref-napi/prebuilds/darwin-arm64/node.napi.uv1.armv8.glibc.node

dado3212 commented 2 months ago

WHOOPS Cmd+Opt+I, my bad. Should pop up something like this, either in a separate window or inline.

image
dado3212 commented 2 months ago

Okay, no need to do this, I think have a repro.

dado3212 commented 2 months ago

Uploaded a version that is hopefully fixed - https://github.com/dado3212/books-annotations/releases/tag/v1.1.1. Let me know if this works for you, and if you run into any other issues. Also out of curiosity, how did you find this repo?

g1azunya commented 2 months ago

Trivially. I was looking for a solution of my problem on reddit, and stumbled upon your comment. As for the new version, it seems to be getting stuck instead of freezing at the same initial step. The good news is that I've managed to launch the inspector this time per your instructions above, and retrieve the console output. Hope this helps!

/private/var/folders/db/60wfp5bd6rj4qv0pbgcyfxc00000gn/T/AppTranslocation/BBAD7D1F-BBAF-44E5-9D76-2F1FEC4DB271/d/Books Annotations.app/Contents/Resources/app/js/renderer.js:37 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'forEach') at startFetch (/private/var/folders/db/60wfp5bd6rj4qv0pbgcyfxc00000gn/T/AppTranslocation/BBAD7D1F-BBAF-44E5-9D76-2F1FEC4DB271/d/Books Annotations.app/Contents/Resources/app/js/renderer.js:37:15) at async HTMLButtonElement. (/private/var/folders/db/60wfp5bd6rj4qv0pbgcyfxc00000gn/T/AppTranslocation/BBAD7D1F-BBAF-44E5-9D76-2F1FEC4DB271/d/Books Annotations.app/Contents/Resources/app/js/renderer.js:226:13)

dado3212 commented 2 months ago

Interesting. Are you okay with sharing your annotation files? Something about my parsing is working for my devices but not yours. You said iExplorer is working correctly, so you'd open that, copy "[iPhone Name] > Media > Books > com.apple.ibooks-sync.plist", "[iPhone Name] > Media > Books > Purchases > Purchases.plist", and "[iPhone Name] > Media > Books > iBooksData2.plist" to your Desktop, and then upload them to this issue. If you'd prefer them not to be public you can also email them to alexcbeals@gmail.com and I'll delete them after I figure out the issue.

g1azunya commented 2 months ago

Sir, if that's some extremely long shot of social engineering that I don't see coming, I'll be truly honored to go down in history as your victim, given the circumstances. For the record, I'm doing this because I hope that Apple Books' native parcer has the same issues with my notes that your app does. And we are talking hundreds of notes over thousands of pages over the past 7 years. So, feel free to check your inbox, Alex.

dado3212 commented 2 months ago

Hopefully fixed by https://github.com/dado3212/books-annotations/releases/tag/v1.2.0 🤞

g1azunya commented 2 months ago

Thank you! It worked liked dark magic: the app didn't even flinch about the unplugged iPhone on the first launch and proceeded with rendering everything without an issue. No wifi, no cord, no problem. The only thing is that the titles are not displayed properly. I'll send you some extra files in case you'd like to look into it.