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

Obsidian freezes and must be killed in certain conditions (easy to reproduce) #574

Open
Fred-Vatin opened this issue Oct 3, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@Fred-Vatin
Copy link

Fred-Vatin commented Oct 3, 2024

Obsidian OS Iconize
1.6.7 Win 10 x64 pro 22H2 v2.14.3

To Reproduce
Steps to reproduce the behavior:

  1. Open the sandbox vault
  2. Install Iconize
  3. IMPORTANT : enable twemoji as emoji style and don’t touch the other options. All is default.
  4. Restart Obsidian
  5. Create a new note and insert this unicode char
  6. Press CTRL+E to switch to reading view
  7. Obsidian freezes and you must kill it and relaunch

Related issues
#524

@spiritualgeek
Copy link

Also, constant freezing when "Toggle icon in links" is switched on. Along with #566, iconize has become completely unusable

@FlorianWoelki FlorianWoelki added the bug Something isn't working label Oct 14, 2024
@FlorianWoelki
Copy link
Owner

Also, constant freezing when "Toggle icon in links" is switched on. Along with #566, iconize has become completely unusable

I don't think that #566 is related to this issue. The official version of Obsidian >1.7 is not released yet. Therefore, I am unable to patch anything.

@spiritualgeek
Copy link

No worries, In my quest for minimalism I've decided to trim back on plugin use. Thanks

@tustin2121
Copy link

This is a particularly annoying bug for me. I'm implementing this workaround, so the app at least doesn't freeze forever in this callback:

--- a/.obsidian/plugins/obsidian-icon-folder/main.js
+++ b/.obsidian/plugins/obsidian-icon-folder/main.js
@@ -5495,6 +5495,7 @@ const createTreeWalker = (plugin, root) => {
 const checkForTextNodes = (treeWalker, match, cb) => {
     let currentNode = treeWalker.currentNode;
     while (currentNode) {
+        if (currentNode.textContent == "™") break; // #574
         if (currentNode.nodeType === Node.TEXT_NODE) {
             const text = currentNode;
             const textNodes = [...Array.from(text.parentElement.childNodes)].filter((n) => n instanceof Text);

It seems like treewalker.nextNode() is returning the current node when the TM unicode character is used, so that the while loop condition never becomes false. When I try to run treewalker.nextNode() from the inspector while breakpointed in the function, I got some exception about the callback no longer being valid, so idk what's going on there.

@chiefnoah
Copy link

This is still present and works with multiple unicode special symbols such as ™ and ©. I suspect either Iconize or Obsidian itself is doing some sort of conversion of the text automatically to map :copyright: / :trademark: to their corresponding code points and vice-versa. When opening the file in another editor, neovim in my case, the unicode symbol is present in the underlying file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

5 participants