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

Plugin causes crashes on iOS #102

Closed
2 tasks done
Pachtjuilaard opened this issue Jun 21, 2023 · 63 comments
Closed
2 tasks done

Plugin causes crashes on iOS #102

Pachtjuilaard opened this issue Jun 21, 2023 · 63 comments
Labels
bug Undesired behavior caused by this plugin upstream bug Undesired behavior caused by a bug in Obsidian or another plugin

Comments

@Pachtjuilaard
Copy link

Pachtjuilaard commented Jun 21, 2023

  • The Plugin is up to date
  • Obsidian is up to date

Describe the bug
Upon loading a note that contains a meta bind field, the app crashes. If the mobile app restarts and loads that same note again, the app freezes before loading. This forces me to change the name of the .md file in iOS files, as Obsidian can not be loaded before the note with the meta bind field is deleted or renamed.

To Reproduce
Steps to reproduce the behavior:

  1. Write some meta bind field on a note: INPUT[text:test]
  2. Close the note, and reopen it.
  3. Obsidian crashes.
  4. If Obsidian reloads that note (doesn't always do that), the app freezes before loading. This makes changing the note in Obsidian impossible.

Expected behavior
To not crash?

Screenshots
If applicable, add screenshots to help explain your problem.

Occurs on
iOS, iPadOS

Plugin version
Any version since 0.4.0

Additional context
Add any other context about the problem here.

@Pachtjuilaard Pachtjuilaard added the bug Undesired behavior caused by this plugin label Jun 21, 2023
@mProjectsCode
Copy link
Owner

I can't reproduce this on my android phone.
Do you have any other plugins active?

@careilly
Copy link

careilly commented Aug 4, 2023

Same problem here, with a clean vault with only this plugin and a single file. Current iOS Testflight (1.4.7 (106), APO v1.3.7).

But not always. And installing Logastranza has, of course, stopped the problem recurring in that vault. In my main vault it still crashes.

It looks like a resource problem: something is running out of memory or something somewhere. When it does work, switching notes is very slow - on the order of five seconds.

@careilly
Copy link

careilly commented Aug 4, 2023

On further investigation, it’s not crashing on iPad, but is taking long pauses, and “this tab is currently busy” messages and becoming unresponsive. I’ll try the “disable plugins one by one” game tomorrow.

@careilly
Copy link

careilly commented Aug 4, 2023

Just started the process by turning them all off and it crashed immediately.

@mProjectsCode
Copy link
Owner

So turning off all plugins crashes it instantly? Then it doesn't seem to be an issue with the plugin but Obsidian, no?

@careilly
Copy link

careilly commented Aug 5, 2023

No, I mean even with all plugins turned off except meta-bind it crashes on phone, locks up on iPad.

@mProjectsCode
Copy link
Owner

mProjectsCode commented Aug 5, 2023

Strange. I still can't repo it on my Android phone and I don't own any Apple device, so I can't test it on one myself.

Could you send me the Vault that crashes as a zip file?
Is it possible to open the developer console on an apple device? If so, could you also send me the contents of the console?

@mProjectsCode mProjectsCode added the help wanted Extra attention is needed label Aug 5, 2023
@careilly
Copy link

careilly commented Aug 5, 2023 via email

@mProjectsCode
Copy link
Owner

i am closing this due to inactivity

@claremacrae
Copy link

I believe I may have seen this. I will report back when I have been able to get a reproduction.

@claremacrae
Copy link

I believe I may have seen this. I will report back when I have been able to get a reproduction.

Summary: I cannot reproduce the crash when meta-bind is the only plugin enabled.

  1. I emptied out my test vault and installed only meta-bind
  2. I added this file, which is pretty much what crashed previously.

MetaBind Examples.md

  1. I then turned on syncing of absolutely everything in the vault
  2. And loaded the vault on iPhone
  3. And could edit the metadata via all the widgets, absolutely fine.

Debug info for this setup:

Debug Info on iPhone - only Meta Bind.md

@claremacrae
Copy link

  1. I then copied all plugin folders from my main vault, in to this test vault.
  2. Then copied in the community-plugins.json
  3. Waited for sync to complete on desktop then mobile
  4. Restarted Obsidian on iPhone

And I was able to edit properties file, absolutely no problem.

@claremacrae
Copy link

So I went back to my main vault and did the following:

  1. Re-enabled Meta Bind
  2. Opened the above note (well, the same table, but it has a bit more descriptive text)
  3. It showed the raw markdown in Reading - couldn't get it to display the widgets
  4. Force-quit Obsidian and restarted
  5. Instead of showing the rendered widgets, Obsidian crashed
  6. Restarted Obsidian (or maybe it restarted itself, I cannot remember)
  7. Unlike when I first tried this 4 days ago, after the (second) restart, the Meta Bind widgets were displayed correctly.

Summary: So it did crash again, but after 2 restarts it was fine.

@claremacrae
Copy link

Here is the debug info for the vault in my previous message:

Debug Info on iPhone - all plugins - my main vault.md

@careilly
Copy link

careilly commented Dec 11, 2023 via email

@mProjectsCode mProjectsCode reopened this Dec 11, 2023
@claremacrae claremacrae mentioned this issue Dec 11, 2023
7 tasks
@mProjectsCode
Copy link
Owner

So I am guessing it is a memory limitation with lots of other active plugins.
Idk if there is anything that i can do about that.

@careilly
Copy link

careilly commented Dec 11, 2023 via email

@mProjectsCode
Copy link
Owner

It seems like in the desktop app it takes around 45 MB of memory to load the plugin thanks to Mathjs. In comparison, base obsidian uses around 30 MB.

@mProjectsCode
Copy link
Owner

So I have two options. Either I ignore the issue or I write my own version of a math string evaluator that is more lightweight. But that might break existing notes as i won't be able to replicate all math js features.

@claremacrae
Copy link

A wild guess. If you are not using all of mathjs, might it be possible to have your own cut-down build of it?

Also, how confident are you that memory is the issue? 45MB doesn't sound that huge to me, naively.

@mProjectsCode
Copy link
Owner

From the other issue, it sounds like it is a startup issue aka when the plugin loads. And it tracks with the other things, e.g. it crashes for you only with lots of other plugins enabled.

@careilly
Copy link

careilly commented Dec 11, 2023 via email

@mProjectsCode
Copy link
Owner

Would disabling math in view fields on iOS help? As a config option maybe?

No, as it allocates all the memory when the module gets loaded.

@mProjectsCode
Copy link
Owner

mProjectsCode commented Dec 11, 2023

Just checked, mathjs also makes up half the bundle size of the plugin.

Bundle size visualization if anyone is interested.
image

@claremacrae
Copy link

Bundle size visualization if anyone is interested.

Wow, it's off-topic, but how did you create that visualisation please?

@careilly
Copy link

careilly commented Dec 13, 2023 via email

@careilly
Copy link

I can cautiously report that a fresh install of Obsidian on my iPhone is working much better than previously, allowing me to cut and paste examples from the test vault without crashing immediately.

@claremacrae
Copy link

According to Sigrunixia, the issue does not occur if obsidian was installed after the iOS 17.0 update. But I can't confirm that.

I think I'm missing something here... I have 50 or more plugins that are working fine on the same iPhone.

So what is it about this plugin which means it's affected by the iOS 17.0 update when most others are not?

@mProjectsCode
Copy link
Owner

So what is it about this plugin which means it's affected by the iOS 17.0 update when most others are not?

Short answer: I don't know.

Long answer:
Since I didn't know what else to do, I contacted the Obsidian team (Sigrunixia) and she took a look at the two bug reports. According to her, this issue looks like a known bug in Obsidian Sync / base Obsidian that the Obsidian devs are already working on fixing. As far as I can tell the bug affects Obsidian indexing and is caused by an iOS/webkit bug that messes with apps trying to delete data.
As to why this plugin makes the issue appear more frequently, I don't know. However, the Obsidian devs are aware that some plugins make this issue appear more frequently.

Sigrunixia made a support post for the issue on the Obsidian TTRPG discord server.
I am not aware of a forum post for this.

@claremacrae
Copy link

Thank you for the reply - much appreciated.

(I'm not on the TTRPG Discord server so can't read that post.)

@careilly
Copy link

I can report that after the complete reinstall on iOS 17.2 I can so far do stuff with MetaBind that I would have expected to make the app completely unusable on iPhone - and changing a linked slider in a note on my iPhone now updates my desktop inside a couple of seconds. So it's certainly improved matters for me.

@careilly
Copy link

A test note with 200 toggles - half linked to another note - and some of the example code is performing perfectly now. I'll do the same process on my iPad and see how that goes - on the iPad it was more causing massive slowdowns than complete crashes.

@careilly
Copy link

I'm not having any problems caused by meta bind now - though I haven't extensively used it yet - but on both iPhone and iPad with up to date operating systems a delete, reinstall and sync has stopped it crashing/locking up.

@scarfur
Copy link

scarfur commented Dec 26, 2023

I can reproduce even after reinstalling obsidian on iOS 17 😢(had it installed since 2y +). It crashes and restarts only when I open the test note. Test note has 191 INPUT fields (some of them are suggesters with 50 options), 73 sliders, 378 dataview inline choice()s and 627 dataview inline fields (=this. or simply this. when nested).
I first thought it is a simple overload but after deleting bigger blocks of content and only with some INPUT numbers left -> same behaviour. Really sad. Can not test with sync - not using it atm.

@mProjectsCode
Copy link
Owner

Does the issue still occur with only dataview and only meta bind?

@scarfur
Copy link

scarfur commented Dec 26, 2023

Does the issue still occur with only dataview and only meta bind?

had the same mindflow and still creating that situation by changing the files. gonna edit soon
// edit: ah me poor one xD give me a minute, I simply turn of the plugins
//// edit2: dataview only and all works normal as expected: no crash

@mProjectsCode
Copy link
Owner

what about only meta bind and no other plugins?
And can you send me your file if possible?

@scarfur
Copy link

scarfur commented Dec 26, 2023

what about only meta bind and no other plugins? And can you send me your file if possible?

sorry that answer do not came on the same edit, the whole crashing and slow start times on iOS, slowing the whole testing down...
The same crash behaviour as before with meta bind ON and dataview OFF.
I am testing now with only meta bind and all other plugins off but I expect no change. Do not have that much enabled on that vault but for clarity I'm still curious to see if anything changes.

// edit: the file does not matter, a simple INPUT field kills it all right away ;P

@mProjectsCode
Copy link
Owner

what iOS version are you using?
You might be running into iOS memory limitations.

@scarfur
Copy link

scarfur commented Dec 26, 2023

what iOS version are you using? You might be running into iOS memory limitations.

Latest version, 17.2.1, that could be true. Tested with meta bind plugin as the only plugin activated and still crashes.

@careilly
Copy link

careilly commented Dec 26, 2023 via email

@scarfur
Copy link

scarfur commented Dec 26, 2023

When you reinstalled, did you use a clean vault? My delete/reinstall was using sync so it zapped the whole vault.Colman On 26 Dec 2023, at 16:35, scarfur @.> wrote: what iOS version are you using? You might be running into iOS memory limitations. Latest version, 17.2.1, that could be true. Tested with meta plugin as the only plugin activated and still crashes. —Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.>

Nope just the app got deleted but thanks for warning everyone

@careilly
Copy link

careilly commented Dec 26, 2023 via email

@scarfur
Copy link

scarfur commented Dec 26, 2023

So did any previously created indexes etc get deleted? 

Obsidian indexed the files again yes ;)

@mProjectsCode mProjectsCode changed the title Bug: Loading note with meta bind fields crashes app on mobile Plugin causes crashes on iOS Jan 9, 2024
@mProjectsCode mProjectsCode pinned this issue Jan 9, 2024
@the1gofer
Copy link

the1gofer commented Jan 20, 2024

I am having the issue when activating the metabind plugin. On both iOS and android.

@mProjectsCode
Copy link
Owner

Does the issue still occur on the latest iOS, obsidian, and plugin versions?

@AniOhev
Copy link

AniOhev commented Feb 27, 2024

No recent crashes iOS 1.5.8

@careilly
Copy link

Last time I tested it didn't seem to crash the mobile version more than the mobile version normally crashes.

@mProjectsCode mProjectsCode unpinned this issue Mar 1, 2024
@mProjectsCode
Copy link
Owner

I will close this issue for now, as it seems to have fixed itself. I will reopen this if the issue reappears.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Undesired behavior caused by this plugin upstream bug Undesired behavior caused by a bug in Obsidian or another plugin
Projects
None yet
Development

No branches or pull requests

7 participants