[Bug] Pressing "return" on empty line creates a new document

Platform

[ X ] iOS (Both iPadOS and iOS)
[ ] Android

Obsidian Mobile version: v0.0.19


I use white space to create space between sections. Unfortunately, when trying to hit the “return” keyboard option to force a new line on an existing line, it somehow interprets that as wanting to create a new document, opening a new pane and passing focus to it.

This ultimately makes it pretty difficult to use. Strangely, though, the behavior happens intermittently - feels like about 50% of the time.

To give a better feel for the bug, here is a screen capture of it happening. Note in the video I added two carriage returns in multiple places, each time getting a new document on the second carriage return.

PS - This seems like an obscure bug (and I’m amazed it hasn’t been documented already), but honestly, it is so dominating and disruptive that it has made using Obsidian on mobile to be nearly impossible. You start writing, hit the customary two “returns” at the end of the paragraph and start writing your next paragraph, only to find that you are in an entirely different note. I must have deleted ~75 empty notes in my vault because of times when I forgot to not hit return twice. :frowning:

That said, I LOVE obsidian, so I’m in for the long haul. Just trying to bring attention to this bug because I haven’t seen it referenced elsewhere.

PPS - And the bug is confirmed in plugin “safe mode”

I am unable to reproduce this issue, and given how highly visible it is, the lack of other people running into this bug should be an indicator that something is wrong with your vault setup/config.

Is there any chance you could have set the hotkey for “Create note in new pane” to something that uses the enter key?
Also, could you create an empty local vault and see if the issues happen there?

Thank you so much Licat for looking at this - your time is so valuable.

Haven’t set any hot keys on desktop or mobile, but I doubled checked the hot keys already, and nothing unusual there. I tried a new vault, and didn’t see the bug pop up immediately - but then it is intermittent.

I’m a coder, so if you could give me a few more days, I’ll try to better characterize it using a new vault and report back with the results. Given that it does not appear to be a widespread bug (phew!), the onus is on me to better characterize it :slight_smile:

1 Like

Thank you for your understanding. If you can find any hints of what the issue might be, do let me know.

Other things I can think of that may be worth looking into:

  • Global (OS level) keybindings
  • Auto-complete/text expanders
  • Keyboard macros
1 Like

Licat (and all) - I’ve reached a point where I have scrubbed out whatever condition causes the bug. Can’t ultimately point to the cause, but the good news is that I’ve found a workaround.

I’ll include the steps below, but the BLUF is that I had some caused by having both an iPad and iPhone use the same .obsidian config folder in an Obsidian synced folder. Programatically, it feels like a race condition in sync might be causing the intermittent nature, although the idea that it would cause a new pane on a new line seems admittedly far fetched. But step through the details below, and it begins to sound at least defensible.


Now the details of what I did to attempt to diagnose and ultimately fix it (of which I suspect only the last step is needed in the case that anyone else encounters this issue):

  1. In addition to previous thread comments, I did confirm that there were no global keybindings. I do use Autohotkey, but did unload it with no change in the bug occurance.
  2. No auto-complete or text expanders or keyboard macros - except iOS keyboard expansions - none of which would even remotely cause the issue
  3. Next, I tried to characterize better which newlines were triggering the new doc. Failure rate was about 50% of the time, but inconsistent. Sometimes between two empty lines. Sometimes at the end of a paragraph. Hitting two carriage returns in quick succession exacerbated the condition to have almost 100% error rate, but that could just be multiplication of the 50% chance.
  4. Creating a new vault (local) made the problem entirely disappear. Woohoo.
  5. Returning to the Obsidian Sync’d vault made the problem remanifest itself on both iPhone and iPad. This suggests that the source of the bug is somehow stored in the .obsidian config files. Note, though, that I also sync to a PC with that configuration and the PC does not show the problem.
  6. Issue persists over full resets of the app - and the most reset app upgrade.
  7. Issue also persists even in plugin safe mode, so it is not plugin related.
  8. I went through every configuration setting and matched every setting on the iPhone, iPad and PC. Problem persisted on iPad and iPhone despite identical settings.
  9. Now it gets interesting - Knowing that it had to be something in the .obsidian folder that is shared by all three devices, I decided to have the iPhone configuration override the config folder location (.obsidian-iphone). In so doing it created a new config for the iPhone.

Upon relaunch, immediately the bug disappeared (!). And not only that, the bug disappeared on both the iPad AND the iPhone - hence the race condition idea.

To confirm it wasn’t an errant setting, I reset the now default settings on the iPhone to be the same as the iPad - and still the bug was gone. So it wasn’t a specific non-default setting.

Finally, I reset the config folder back to the shared .obsidian default folder, and voila, bug was instantly back. Switching the iphone back to its own .obsidian-iphone folder and again, problem solved - no more new notes when hitting return.

So… conclusion:
A) I have a working solution - have my shared iPad and iPhone use different obsidian folder locations. One can be the same as a PC, but not both.
B) Implication is that something in the .obsidian folder structure, but outside of settings and plugins, is causing an issue between iPad and iPhone.
C) Assuming B), then the sync json may be the issue, as it is one of the few things actively modified as one types.
D) The relatively rarity of the bug may be because I am one of the few using both iPhone and iPad (and potentially PC).

From here, I’m happy as a clam. I’m happy to help debug further, having a config that can manifest the bug quickly when needed. But otherwise, happy to call this issue closed - and leave all the details up for any future users that encounter it.

@Licat - if you’ve made it this far :slight_smile: I hope this helps. Thanks for all the hard work. Truly amazing work.

– z2K (aka truth)

Wow, that’s some hard work investigating the bug!

One thing that seems off - Obsidian Sync currently doesn’t sync the .obsidian folder. Does that mean you’re syncing the vault through iCloud at the same time?

One other thing, if you’re ok with it, is if you can send me a zip of your .obsidian folder through Discord (Licat#1607), and I can try to investigate any possibilities.

@Licat - Funny, I came to the same realization on sync not syncing the .obsidian folder right after posting. Definitely throws a kink into my outside-the-black-box sleuthing.

I don’t use iCloud syncing, storing the vaults in the local Obsidian sandbox. That said, there is one other problem that I thought I had ruled out - I do have a dropbox sync of the obsidian folder on the PC. I did try to rule this out as a problem though by making sure that the PC was off during the bug testing (and thus no active race conditioning possible).

Happy to send over the zip’d .obsidian folder via discord, and will follow up there.

(*) And just confirmed - I disconnected PC from net and shut it down, so no connection to dropbox existed. Then I switched back to a shared .obsidian folder and the bug immediately reappeared.

Yeah, so that’s the question… how is the .obsidian folder shared if it wasn’t synced by Obsidian Sync?

Just closing out this bug. Licat raises good points on the .obsidian folder not being sync’d as to figuring out the culprit. Ultimately, a working solution (for me) was to change the obsidian confit folder on one of my iDevices to be something else got rid of the bug.

And with that, I think we can close out this bug (not sure how to do that of the forums). Thanks for all the help in tracing this down.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.