obsidian-custom-sort icon indicating copy to clipboard operation
obsidian-custom-sort copied to clipboard

Custom sort does not work on linux

Open whdmike opened this issue 11 months ago • 3 comments

I have Fedora Kinoite OS, and custom sort doesn't work. Occasionally, when obsidian is open for longer time I can click and it starts working, but generally it doesn't.

This is from console:

plugin:custom-sort:41 custom-sort v3.1.2: failed to get active File Explorer view. Until the File Explorer is visible, the custom-sort plugin cannot apply the custom order.

loading custom-sort v3.1.2 app.js:1 Uncaught TypeError: _b.requestSort is not a function at eval (plugin:file-explorer-plus:2706:61) at t.tryTrigger (app.js:1:723006) at t.trigger (app.js:1:722939) at t.trigger (app.js:1:2189762) at t. (app.js:1:2128966) at l (app.js:1:518105) at c (app.js:1:518221)

app.js:1 TypeError: _a.requestSort is not a function at eval (plugin:file-explorer-plus:2700:59) at t. (app.js:1:2155014) at app.js:1:237228 at Object.next (app.js:1:237333) at a (app.js:1:236051) (anonymous) @ app.js:1

app.js:1 Uncaught TypeError: _b.requestSort is not a function at eval (plugin:file-explorer-plus:2706:61) at t.tryTrigger (app.js:1:723006) at t.trigger (app.js:1:722939) at t.trigger (app.js:1:2189762) at t. (app.js:1:2128966) at l (app.js:1:518105) at c (app.js:1:518221)

whdmike avatar Jan 30 '25 10:01 whdmike

Hi @whdmike

thanks for reporting the problem with the detailed log! It is definitely helpful in troubleshooting. The first message (failed to get active File Explorer view) typically is related to Obsidian deferred views. And from practical standpoint it means you have to wait for the File Explorer to be visible (or show it manually) in order to apply custom sorting.

At the same time, the subsequent messages in the log Uncaught TypeError: _b.requestSort is not a function suggest some bug.

Thanks for posting! Will investigate at next opportunity.

SebastianMC avatar Jan 31 '25 17:01 SebastianMC

Just an update. Today as Obsidian version 1.8.4, I noticed that sometimes works (after a restart), sometimes not.

Just in case, posting info from console.

app.js:1 Uncaught TypeError: _b.requestSort is not a function at eval (plugin:file-explorer-plus:2706:61) at t.tryTrigger (app.js:1:741961) at t.trigger (app.js:1:741894) at t.trigger (app.js:1:2256223) at t. (app.js:1:2194250) at c (app.js:1:533307) at u (app.js:1:533427) app.js:1 TypeError: _a.requestSort is not a function at eval (plugin:file-explorer-plus:2700:59) at t. (app.js:1:2221762) at app.js:1:239667 at Object.next (app.js:1:239772) at a (app.js:1:238490) (anonymous) @ app.js:1 app.js:1 Uncaught TypeError: _b.requestSort is not a function at eval (plugin:file-explorer-plus:2706:61) at t.tryTrigger (app.js:1:741961) at t.trigger (app.js:1:741894) at t.trigger (app.js:1:2256223) at t. (app.js:1:2194250) at c (app.js:1:533307) at u (app.js:1:533427)

whdmike avatar Feb 03 '25 15:02 whdmike

Happy to report that for the second day, custom sort works as it should. Will wait few more days to make it sure and report again.

whdmike avatar Feb 05 '25 07:02 whdmike

Lately I have again very ofter problems with custom sort. Could it be that it is conflicting or connected with File explorer Plus?

editingToolbar v3.1.8 loaded plugin:multi-column-markdown:5640 Loading multi-column markdown plugin:dataview:20478 Dataview: version 0.5.68 (requires obsidian 0.13.11) plugin:custom-sort:44 loading custom-sort v3.1.2 plugin:recent-files-obsidian:6 Recent Files: Loading plugin v1.7.4 2app.js:1 Uncaught TypeError: _b.requestSort is not a function at eval (plugin:file-explorer-plus:2706:61) at t.tryTrigger (app.js:1:742047) at t.trigger (app.js:1:741980) at t.trigger (app.js:1:2258184) at t. (app.js:1:2196159) at c (app.js:1:533397) at u (app.js:1:533517) plugin:dataview:13006 Dataview: all 4682 files have been indexed in 0.779s (4682 cached, 0 skipped). app.js:1 TypeError: _a.requestSort is not a function at eval (plugin:file-explorer-plus:2700:59) at t. (app.js:1:2223660) at app.js:1:239667 at Object.next (app.js:1:239772) at a (app.js:1:238490) (anonymous) @ app.js:1 plugin:omnisearch:107 Indexing total time: 6547.34619140625 ms 2plugin:custom-sort:41 custom-sort v3.1.2: failed to get active File Explorer view. Until the File Explorer is visible, the custom-sort plugin cannot apply the custom order.

whdmike avatar Mar 27 '25 09:03 whdmike

Hi @whdmike,

in the log which you posted I can see two errors reported by the file-explorer-plus. These errors indicate the file-explorer-plus is not handling the Obsidian delayed views correctly. It has nothing to do with custom-sort plugin, it is about compatibility of file-explorer-plus with newer features of Obsidian. The file-explorer-plus should correctly handle the new Obsidian delayed views and stop raising these errors.

At the same time you can see in the two last lines of the log that the custom-sort plugin does not generate errors and can recognize that the File Explorer view is not available. This most likely represents the Obsidian delayed view condition: "... failed to get active File Explorer view. Until the File Explorer is visible, the custom-sort plugin cannot apply the custom order."

So, to recap:

  • the source of the problem are the delayed views introduced in some of recent Obsidian releases
  • handling of these delayed views correctly in a plugin poses some real challenges
  • I don't know if the two plugins file-explorer-plus and custom-sort can coexist without interference. At a glance there will be a conflict if both plugins attempt to manage order of items in the same folder. Depending on the startup sequence and which plugin get's initialized first, one or the other will 'win'.
  • custom-sort plugin has been intentionally written as a good-Obsidian-citizen with intention not to interfere with other plugins and seamlessly cooperate with them. Thus, it can be used with many of File-explorer related plugins without interferences
  • for the file-explorer-plus I have no idea what approach was taken for integration with other plugins. It is possible that the file-explorer-plus (which is not handling errors correctly) leaves the File Explorer view in some unpredictable state, thus preventing custom-sort from working correctly
  • long term, when file-explorer-plus code is updated to handle errors gracefully I would be curious to spend some time and see if and how the two plugins cooperate. And maybe sync-up with the author of file-explorer-plus for remediation of interferences, if there are any

SebastianMC avatar Mar 27 '25 13:03 SebastianMC

I disabled explorer plus and still custom sort doesn't work

plugin:custom-sort:41 custom-sort v3.1.2: failed to get active File Explorer view. Until the File Explorer is visible, the custom-sort plugin cannot apply the custom order. plugin:omnisearch:107 Indexing total time: 6845.2509765625 ms plugin:custom-sort:41 custom-sort v3.1.2: failed to get active File Explorer view. Until the File Explorer is visible, the custom-sort plugin cannot apply the custom order. 4 plugin:custom-sort:41 custom-sort v3.1.2: failed to get active File Explorer view. Until the File Explorer is visible, the custom-sort plugin cannot apply the custom order.

whdmike avatar Mar 27 '25 13:03 whdmike

Hi @whdmike,

please confirm the scenario: the File Explorer view is displayed and visible, you try to apply the custom sorting and it fails with the message as in the attached logs.

In the logs the plugin is complaining about File Explorer view not available which means that for some reason it can't get a handle to the File Explorer.

If that's the case please provide a list of active plugins - maybe some other plugin interferes.

SebastianMC avatar Mar 31 '25 08:03 SebastianMC

Hi @SebastianMC Honestly, I uninstalled both plugins, and numbered my 20 folders to sort them ...

whdmike avatar Mar 31 '25 17:03 whdmike

Hi @whdmike

thanks for the update!

That is the (sad unavoidable) reality of (free) software which involves community-based also free plugins. Developing a core idea of a feature as a plugin is one thing. Second thing is to make it work on all supported platforms in all typical configurations. And finally, maintaining this working-and-compatible state long term could be a challenge. And when it comes to edge cases...

I'm with Obsidian almost since the very beginning and if you scan the plugins repository, there are many useful plugins, which are left unmaintained, because of the cost involved and/or because the author lost interest in it and then, breaking changes in the platform itself (Obsidian) rendered these plugins unusable.

I frequently apply the same approach as you described: if I can do something on Obsidian directly, not involving plugins, I go that way. Tried many plugins, stayed with a limited minimal set.

BTW just recently a new plugin for manual drag & drop sorting was announced on Obsidian forums, then released and is getting traction now: https://github.com/Kh4f/obsidian-manual-sorting While it is still at its early stages, maybe it is a good try for a vault with 20 folders?

SebastianMC avatar Mar 31 '25 19:03 SebastianMC