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

Crash on Startup after using iOS-build-in method to setup new device #1541

Closed
dignifiedquire opened this issue Apr 14, 2022 · 9 comments
Closed
Labels

Comments

@dignifiedquire
Copy link
Member

This happens on every startup atm

Screen Shot 2022-04-14 at 20 00 03

@r10s
Copy link
Member

r10s commented Apr 15, 2022

some debug ideas:

  1. a few lines above, we iterate over dcAccounts.getAll() - is it already empty there?
  2. if so, is the secret retrieved from KeychainManager
  3. i assume, the account is not encrypted? (just an upgrade, no export -> import-encrypted involved?)
  4. maybe the log shows what is going on in core?
  5. finally, can the database be opened in the repl tool or in dc40/dreamer as suggested by @Simon-Laux ? however, not sure how this is easily doable, Xcode / Window / Devices and Simulators / Installed Apps / Delta Chat / ... / Download container does not extract the "shared data" we are using to make the share extension possible.

however, maybe 5. is not needed, 1.-4. may already give some hints. also, the list is probably not complete, i am sure there are good debug ideas i've overseen.

@dignifiedquire
Copy link
Member Author

dignifiedquire commented Apr 17, 2022

yes to 1, it is empty
no encryption, this db was last used before that was a thing

@cyBerta
Copy link
Contributor

cyBerta commented Apr 18, 2022

@dignifiedquire did you import your database? I vaguely remember you said you uninstalled the app in between? I'm asking because if it is an backup, it might help to reproduce/debug the issue outside of ios.

What puzzles me is that dcAccounts.add() fails even. That might be a corrupted db.

@dignifiedquire
Copy link
Member Author

I did not import in the dc sense, I copied over my whole storage, through iOS, as I switched phones

@cyBerta
Copy link
Contributor

cyBerta commented Apr 19, 2022

If you're in debugging mood: could you try to create a breakpoint just before the fatalError is shown and enter in the lldb debug console

po FileManager.default.contentsOfDirectory(at: FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.chat.delta.ios")!.appendingPathComponent("accounts"), includingPropertiesForKeys: nil)

it should show you the accounts folders, like:

▿ 3 elements
  ▿ 0 : file:///private/var/mobile/Containers/Shared/AppGroup/F8F247E7-8465-4389-A280-88D24C2976BF/accounts/59b8cd0277c4430896525c3430d020b0/
    - _url : file:///private/var/mobile/Containers/Shared/AppGroup/F8F247E7-8465-4389-A280-88D24C2976BF/accounts/59b8cd0277c4430896525c3430d020b0/
  ▿ 1 : file:///private/var/mobile/Containers/Shared/AppGroup/F8F247E7-8465-4389-A280-88D24C2976BF/accounts/24c20f2c30ae47c59d28135e79d6sba0/
    - _url : file:///private/var/mobile/Containers/Shared/AppGroup/F8F247E7-8465-4389-A280-88D24C2976BF/accounts/24c20f2c30ae47c59d28135e79d6sba0/
  ▿ 2 : file:///private/var/mobile/Containers/Shared/AppGroup/F8F247E7-8465-4389-A280-88D24C2976BF/accounts/accounts.toml
    - _url : file:///private/var/mobile/Containers/Shared/AppGroup/F8F247E7-8465-4389-A280-88D24C2976BF/accounts/accounts.toml

could you then please enter
po FileManager.default.copyItem(at: FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: "group.chat.delta.ios")!.appendingPathComponent("accounts"), to: FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appendingPathComponent("group.chat.delta.ios").appendingPathComponent("accounts"))

that should copy all account data into the document directory. You can then export the database and we're a step further in debugging.

@cyBerta
Copy link
Contributor

cyBerta commented Apr 22, 2022

@r10s mentioned we should try to reproduce that update path described by @dignifiedquire
I can try next week, although I would feel more comfortable if I could use two testing devices instead of one testing device + one daily driver.

@dignifiedquire
Copy link
Member Author

xcode is currently not willing to start debug mode anymore on my iphone -.-

@cyBerta
Copy link
Contributor

cyBerta commented Apr 22, 2022

xcode is currently not willing to start debug mode anymore on my iphone -.-

💃 update dance 🕺 , it's so fun

@r10s r10s changed the title Crash on Startup Crash on Startup after using iOS-build-in method to setup new device Jun 20, 2022
@r10s
Copy link
Member

r10s commented Dec 8, 2022

this is tracked more on-point at #1762 now.

@r10s r10s closed this as completed Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants