Obsidian 1.7.0: "aliases" key isn't saved if left empty and created through the "Add alias" command

I’ve stumbled upon something a bit strange in the behavior of the Add alias command on the latest Insider/Catalyst release: Obsidian 1.7.0 :blush: .

It appears that if I create an aliases key in Live Preview (so in Properties) using the command Add alias available in the command palette but leave its value blank/empty the brand new aliases key showing up in Properties isn’t actually saved/written on file in Source unless I add an alias as a value to the key and then remove it or another property/key to Properties :innocent:.


Steps to reproduce

  1. Open the Sandbox vault
  2. Split right the note Start Here.md so you can see the same note side by side (whether both tabs are linked or not doesn’t matter).
    1. Leave the one on the left in Live Preview
    2. Set the one on the right in Source Mode
  3. Focus on the note in the left pane (the note in Live Preview) by placing your cursor anywhere in the content of the note (e.g.: on line 1)
  4. Hit Cmd + p to trigger the command palette, look for the Add alias command and select it.
  5. Once the aliases key appears (seemingly creating Properties in Start Here.md at the same time), reset the focus on the content of the note (e.g.: by putting the cursor after the sentence Hi, welcome to Obsidian! or by hitting the Tab key until you’re out of Properties)
  6. Observe the result on Start Here.md previously set to Source Mode in the right pane: No YAML block containing an empty aliases key has been created :woman_shrugging:

Notes:

  • Having the same note opened in a split view doesn’t really matter to repro this :blush: : It also happens when using the Add alias command on a note in LP and then simply switching to Source :blush: .
  • This also seems to happen if there are already some Properties in LP (YAML block in Source) and if one adds an aliases key using the command but leaves its value empty: the aliases key is only saved if one interact with it (adding a value) or interact with Properties (adding another key).

Did you follow the troubleshooting guide? [Y/N]

Yes :blush: ! This has been tested and reproduced in the Sandbox vault.


Expected result

Adding an aliases key to Properties in Live Preview using the command Add alias should write that key in the YAML block in Source Mode regardless of the value of the key (empty or not) imho :innocent: .
Especially since this doesn’t happen if one uses the command Add file property and then select aliases in the dropdown once Properties is focused on :blush: . In that case, regardless of the value of the brand new aliases key, the key is saved/written on file (in Source Mode)


Actual result

The aliases key shows up in Properties in Live Preview but doesn’t actually exists as it’s not written on file in Source… and as it doesn’t exist, the command Clear files properties doesn’t work (at least, if the aliases key is the only key appearing in Properties and if that key was added to the note using the command Add alias but its value was left empty).
The only way to get rid of the “ghost” aliases key in Properties in that specific case is to close and re-open the note :blush: .
(Hitting cmd + z trying to undo the effect of using the add alias command doesn’t seem to work either… I can only guess this is also happening because the empty aliases key doesn’t actually exist anywhere while still being visually present in Properties in LP :woman_shrugging: )

Screen-recordings:

From the Sandbox vault :blush:

Test 1:
Using the Add alias command on a note without any Properties and leaving the value of the seemingly created aliases key empty (then hitting Tab to get back to the content of the note) → the empty aliases key isn’t created in Source (same for the whole YAML block)

Obsidian 1.7.0 - Add alias command 1

Test 2:
Using the Add alias command on a note without any Properties and leaving the value of the seemingly created aliases key empty then clicking on the + Add property to add a test key → the empty aliases key is created in YAML in Source as soon as the new test key is added to Properties (in LP)

Obsidian 1.7.0 - Add alias command 2

Test 3:
Using the Add alias command on a note with at least a key already present in Properties and leaving the value of the seemingly created aliases key empty (then hitting Tab to get back to the content of the note) → the empty aliases key isn’t created in Source

Obsidian 1.7.0 - Add alias command 3

Test 4:
Using the Add file property command to add an empty aliases key to a note without any Properties → the empty aliases key is created in Source.

Obsidian 1.7.0 - Add file property command


Environment

MacBook Pro (M2 Pro) + MacOS Sonoma 14.6.1 (23G93) + Obsidian 1.7.0 (Installer 1.6.7)

SYSTEM INFO:
	Obsidian version: v1.7.0
	Installer version: v1.6.7
	Operating system: Darwin Kernel Version 23.6.0: Mon Jul 29 21:13:04 PDT 2024; root:xnu-10063.141.2~1/RELEASE_ARM64_T6020 23.6.0
	Login status: logged in
	Catalyst license: supporter
	Insider build toggle: on
	Live preview: on
	Base theme: adapt to system
	Community theme: none
	Snippets enabled: 0
	Restricted mode: on

RECOMMENDATIONS:
	none

Additional information

  • There’s no error showing up in the console in the Dev Tool
  • The “ghost” empty aliases key also doesn’t show up in Reading view (as far as I could see)
  • I hope the gifs are big enough to show the results I get :blush: (if not, I still can try other sizes :innocent: )
  • I first saw this on my iPad Pro (iPadOS 17.6.1) + the latest Catalyst/Insider release of Obsidian Mobile (Obsidian 1.7.0 (153)) and somewhat reported it on the dedicated Discord channel here :blush: … As it also happens on desktop, I was asked to open a BR so, here I am :smile:
  • Sorry for the length though :see_no_evil: !

Thanks

1 Like

will be fixed 1.7.1

1 Like

Thank you :grin: !

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