kevboh / longform

A plugin for Obsidian that helps you write and edit novels, screenplays, and other long projects.
Other
672 stars 30 forks source link

Index file does not get updated when making changes via Longform pane. Longform pane does not initialize from index file upon start-up. #263

Closed Ryuuramaru closed 3 months ago

Ryuuramaru commented 3 months ago

Versions Longform version: 2.0.7 Obsidian version: 1.6.7 (happened on 1.6.5 also, but did NOT happen before that) OS [e.g. macOS, Windows, iOS, Android]: Linux (Flatpak), Android Theme: default Other plugins that you think might be relevant here:

Describe the bug

These are two separate behaviors, but I feel like they're part of the same bug.

To Reproduce Steps to reproduce the behavior:

  1. Have a Longform project with multiple scenes.
  2. Open Obsidian
  3. Open Longform pane
  4. Notice Longform pane not showing the project that it should have imported from the Index file.

OR

  1. Have a Longform project open.
  2. Add a scene either from the Longform pane (or change any setting)
  3. Notice the Index file not updating to reflect the changes.

Expected behavior Longform should properly update and read its index file to keep track of a user's project.

Screenshots

First Behaviour: Upon opening Obsidian: image Upon manually editing the Index file: image

Second Behaviour: Pre-change: image Post-change (notice the Index file is unchanged): image

Additional context

Console errors:

Uncaught TypeError: Cannot read properties of null (reading 'left')
    at VerticalLinesPluginValue.recursive (plugin:obsidian-outliner:2565:41)
    at VerticalLinesPluginValue.calculate (plugin:obsidian-outliner:2484:30)
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'length')
    at ignoredPatternToRegex (plugin:longform:36596:41)
    at eval (plugin:longform:36543:64)
    at Array.map (<anonymous>)
    at StoreVaultSync.eval (plugin:longform:36543:53)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:longform:28:58)
Ryuuramaru commented 3 months ago

Just tested (probably should have done this beforehand), this does NOT happen inside a new vault with only Longform installed. The console also does not log any errors: image

Disabling all plugins from my actual vault and restarting Obsidian does NOT fix the issue. It does however only generate 1 error instead of 2.

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'length')
    at ignoredPatternToRegex (plugin:longform:36596:41)
    at eval (plugin:longform:36543:64)
    at Array.map (<anonymous>)
    at StoreVaultSync.eval (plugin:longform:36543:53)
    at Generator.next (<anonymous>)
    at fulfilled (plugin:longform:28:58)
Ryuuramaru commented 3 months ago

I managed to fix it:

  1. Uninstall Longform
  2. Remove all Index files
  3. Reinstall Longform
  4. Create a new Longform project in the same folder with the same name as the previous project.

This will cause the Index file to be created in the place of the old one, and all scenes will be picked up by the auto-adder. I have no idea why this works however, but I'm leaving it here just in case anyone else has issues.

This fix also removes all errors in the console, in case this info proves useful.

Ryuuramaru commented 3 months ago

Closing this as I managed to fix it on my own, and it could just be due to an Obsidian update. If it reoccurs, I will reopen it.