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

File Load Error for Untitled 2.ipynb #324

Open
Stritheo opened this issue Jan 18, 2024 · 15 comments
Open

File Load Error for Untitled 2.ipynb #324

Stritheo opened this issue Jan 18, 2024 · 15 comments

Comments

@Stritheo
Copy link

I've downloaded the iOS app twice and keep getting this error when I open the file. I've been online to watch a tutorial and this doesn't appear to be normal.

Can you please help?

Thanks

@holzschu
Copy link
Owner

First, thank you for reaching out. It's definitely not normal, but similar issues keep happening to random users, and I'd like to fix it.
If you don't mind helping me, if have questions:

  • I assume you created Untitled 2.ipynb, am I right?
  • in which directory did you create the file? Does it happen everywhere?
  • is it the same if you click another time on the "+" button?
  • can you take a screenshot? (by looking at the error message, I can maybe deduce where it happens)

@Stritheo
Copy link
Author

Stritheo commented Jan 19, 2024 via email

@holzschu
Copy link
Owner

Thank you for the replies. I am still unsure about why it happens --- which is normal, it's a big issue that's been resisting for years, I don't think it'll be solved in a day.

The only thing that is certain is that it happens on what appears in the file browser as "iCloud/Carnets". I assume that if you navigate to "On my iPad/Carnets", then try to create a file, then it works, right?

I'm going to upload a TestFlight version of Carnets that displays more information when Carnets fails to write on its own iCloud folder (it's not solving the issue, it's just telling more about what is happening). It usually takes a few days for a new TestFlight version to be active, I'll let you know as soon as it is.

One last thing: github has removed your screenshot from the e-mail message (it's kind of annoying for that). Could you navigate to #324 and add it by hand?

@Stritheo
Copy link
Author

Stritheo commented Jan 19, 2024 via email

@holzschu
Copy link
Owner

I don't fully understand your questions. But I can tell you that Carnets has (should have) full access to two directories: "On my iPad/Carnets" and "iCloud Drive/Carnets". Both "belong to" Carnets, so it can do everything in these: open files, create files, create new files... For the other directories, you need to grant permission, either on a file-by-file basis (clicking on a file in the navigator grants permission) or by directory (clicking on the "unlock folder" icon).

To go back to your original question: I actually found some things to change in the code. It could be fixed. The test version is here: https://testflight.apple.com/join/UbNIjkjp

(It's the experimental version of Carnets-with-Scipy, to test things such as bug fixes before I put them on the AppStore. If you've never done this: click on the link on your iPad, it will ask you to install the TestFlight app, do it, then install Carnets-with-Scipy using the TestFlight app). Please tell me how this new version behaves, especially for "iCloud Drive/Carnets".

@holzschu
Copy link
Owner

@Stritheo did you have the time to check the experimental version? Does it improve access to iCloud?

@Stritheo
Copy link
Author

Stritheo commented Jan 24, 2024 via email

@holzschu
Copy link
Owner

Thanks for the report. I find that very odd: you should have seen different errors, with more information about why it cannot access the files. I guess that's a clue, I'll look into it again.

@andrewcrook
Copy link

andrewcrook commented Feb 21, 2024

I just downloaded from App Store and have same issue on iPadOS 17.3.1

  1. when I start it shows the file interface
  2. I click “create new document” icon
  3. I then get the following error...

IMG_2781

  • if I create a new notebook under jupyter’s ui I get the same error.
  • if I go back to the file interface and click on one of the new files I also get the same error. (they seem to be created)

@holzschu
Copy link
Owner

Thanks for the report. From what I can see, between your report and the code:

  • the system has created the notebook files (at least three of them)
  • somehow, JavaScript is not able to access them (this is a JavaScript error message, corresponding to a JavaScript exception being raised)
  • different method for creating the file cause the same error, which makes sense since the error happens when loading the new file (that's the only thing that makes sense so far).
  • So basically a file that exists (according to the system) does not exist (according to JavaScript). Since JavaScript just asks the system about the file, this should obviously not happen.

I suspect the issue is connected with iCloud in a way that I don't understand. I believe that if you navigate to "On my iPad", then "Carnets", then you should be able to create a new notebook there. You also have the option to change the notebook distribution to "nbclassic" instead of "notebook", using the Settings app, but I don't think it will change anything, except maybe the error message.

Thanks again for the report and the screenshot. I still have no idea what is happening or how to fix it, and I'm unable to reproduce it on any of my machines, but I have a slightly clearer idea of where it is happening.

@andrewcrook
Copy link

andrewcrook commented Feb 25, 2024

Its iCloud for sure

  • If I try or open in other folders in iCloud Drive it cannot open the files

  • I cannot actually find default folder on iCloud via folder app

  • Yes, its works "on device"

  • Perhaps it needs to be implemented in Swift code using cloudkit and provided as a API to webview for JavaScript to intergrate with.

https://stackoverflow.com/questions/25827368/swift-webview-how-to-call-correctly-swift-code-from-javascript

  • There is clouldkitjs but I don't know much about it and needs to authenticate via the web login. It doesn’t sound like a nice alternative in this case.

https://developer.apple.com/documentation/cloudkitjs

@holzschu
Copy link
Owner

Thank you for the details. So yes, it is specific about iCloud. I don't think it is connected to JavaScript specifically, since it works on many machines (but not yours).

Just checking two points:

  • is your iPad using "Lockdown mode"?
  • if you open the Settings app, you'll see your Apple ID at the top. If you click on it, then "iCloud", then "iCloud drive", you'll see "Apps syncing to iCloud drive". Can you check if "Carnets" is on the list, and authorised?

@andrewcrook
Copy link

is your iPad using "Lockdown mode”?

No it is off

if you open the Settings app, you'll see your Apple ID at the top. If you click on it, then "iCloud", then "iCloud drive", you'll see "Apps syncing to iCloud drive".

yes it is enabled for Carnets

I do actually have other JavaScript based apps working such as Obsidian.
All my software on Apple devices are on the latest versions apart from my iPhone hence I don't have "Advanced Data Protection" enabled yet.

@holzschu
Copy link
Owner

Thank you again for all the information you provide. I have re-read Apple developer documentation, and the only thing I got was that this issue should not happen, and therefore is not documented.

I'm going back to your previous message: "If I try or open in other folders in iCloud Drive it cannot open the files". My understanding is that, even if you've copied a notebook from another place onto your iCloud Drive, and then clicked to open it, you get the "does not exist" error. Am I correct in this interpretation? Is is "does not exist", or another error message? (even the smaller clues can help).

I have another question: if you open the Settings app, and scroll down to "Carnets", there is an option titled "Document Storage". What does it say for you?

@holzschu
Copy link
Owner

holzschu commented Mar 7, 2024

Hi again,
I think I've managed to fix this issue. The fix is available on the TestFlight version, if you want to try: https://testflight.apple.com/join/yevwlUs1

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

No branches or pull requests

3 participants