kevboh / longform

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

Adding a project to Longform causes plugin to lose all projects #135

Closed radioactive-penguin closed 1 year ago

radioactive-penguin commented 1 year ago

I added a project with 98 chapters to Longform the other three projects that were in the plugin simply vanished. They are no where to be found. This issue exhibits itself on my desktop running 1.19 as well as my iPad (running 1.41) Settings for Longfrom plugin do not seem to be synced between devices (all the sync settings are turned on so I should be syncing the index files across.

Just something I noticed happening today

anon3792737 commented 1 year ago

I've noticed this behavior has well.

In my case, I noticed that in the index file for each project, the "Scene" YAML had [ ] added to it, with the scenes listed after.

Like this

scenes: [] -scene 1 -scene 2

Changing it to

scenes: -scene 1 -scene 2

fixed the issue.

kevboh commented 1 year ago

I have a suspicion that this is the result of some underlying changes in how Obsidian handles frontmatter. I'm curious if #136 fixes it. I'll try to release this change soon.

kevboh commented 1 year ago

Let me know if 2.0.2 fixes this.

celtickuma commented 1 year ago

Updated to 2.0.3 Added a new multi project New project not in Longform tab Index.md for new project contains no YAML data Project folder contains no scenes folder Reloaded Obsidian without saving Manually added YAML data to Index Reloaded Obsidian without saving All projects disappeared from Longform tab All files still intact Closed vault Closed Obsidian Restarted Obsidian No projects in Longform tab Reloaded without saving Loading cache took a long time (tens of seconds, not minutes) No projects in Longform tab deleted all Cache/Cache_Data files (438 of 'em) No effect deleted all Cache/Cache_Data files deleted all Code Cache/js files (88) No effect No Projects in Longform tab

celtickuma commented 1 year ago

Loaded 2.0.2 Same results as above No projects in Longform tab despite multiple restarts and creating new projects. No YAML in Index

celtickuma commented 1 year ago

No data.json is being written to the/Users/.../.obsidian/plugins/longform folder

celtickuma commented 1 year ago

Dropped back to 2.0.1. Created a new project YAML written properly Data.json created Project appears on tab Reloaded vault No projects on tab Forced a reindex by deleting indexed db at /Users/.../Library/Application Support/obsidian/IndexedDB/app_obsidian.md_0.indexeddb.leveldb All projects are back on the Longform tab If you have a documented test protocol I'd be happy to run through it here.

kevboh commented 1 year ago

Thanks for the steps. I'll take a look.

kevboh commented 1 year ago

@celtickuma just to clarify: when you're "adding a new project," what exactly are you doing? Are you manually writing YAML frontmatter? Are you using one of the insert frontmatter commands?

kevboh commented 1 year ago

I'm specifically interested in your step Index.md for new project contains no YAML data. This just isn't a thing in Longform 2.x. The YAML is the project.

kevboh commented 1 year ago

@radioactive-penguin can you reproduce this on the latest version of Longform?

radioactive-penguin commented 1 year ago

I just added a project and this is still occurring. https://github.com/kevboh/longform/issues/135#issuecomment-1369338687 is what fixes it, (Needs to be done on the new project) I'm running LF 2.0.3 on Obsisian 1.19 on Windows.

celtickuma commented 1 year ago

Per your https://github.com/kevboh/longform/issues/135#issuecomment-1374494221 I've listed every step I've taken below. I tested 2.0.1, updated to 2.0.3, and walked through the same steps The bottom three lines of the long list below are:

  1. Verify metadata in Index file
  2. There is no metadata in Index file
  3. There is one word in the Index file: "Index"

If you have a specific test protocol you'd like me to use, please shoot it to me and I'll try to perform it as accurately as possible, but I'm not doing anything outside of the UI here. If there is anything else you'd like me to try, I'd be happy to do so. I love this plug-in and would like to use it in production. I'm getting the same behaviors on two different MBPs running two different versions of macOS.

As a test, I created a brand new vault. The only community plugin is Longform 2.0.3. I created a folder. Made the folder a Longform project. The Index file contains one word: "Index" There are no projects on the Longform pane.

Environment:

Initial Conditions: Vault Open Longform Plugin unloaded Longform Pane closed

Actions: Close vault Quit Obsidian Open Obsidian Initialize Longform plugin Verify Longform Tab available Click Longform Tab "To use Longform" message displayed with empty Project Create new folder "Test Issue 135" Right-click on folder Click Create Longform Project Select Multi Enter Title: Test Issue 135_2_0_1 Click Create Verify new folder created Verify Index file created Verify Metadata is correct Create subfolder "scenes" Change metadata sceneFolder to: /scenes Close Index Verify Project in Longform pane Close vault Close Obsidian Open Obsidian Last vault opens Verify Test Issue 135 folder and Index file exist Click on Longform pane There are no projects in the Longform pane Go to Command Palette Select Reload app without saving There are no projects in the Longform pane Unload Longform Plugin Close Longfrom pane Close vault Quit Obsidian Open Obsidian Used updater to update Longform to 2.0.3 Loaded installed Longform 2.0.3 Opened Longform pane There are no projects listed Go to Command Palette Select Reload app without saving There are no projects in the Longform pane Right click on folder Test Issue 135 Right-click on folder Click Create Longform Project Select Multi Enter Title: Test Issue 135_2_0_3 Click Create Verify new folder created Verify Index file created Verify metadata in Index file There is no metadata in Index file There is one word in the Index file: "Index"

kevboh commented 1 year ago

Are there errors in the console? If no data.json is being written there's some error being triggered on plugin save.

kevboh commented 1 year ago

Can you attach the test vault in which you can reproduce this?

kevboh commented 1 year ago

Obsidian 1.0.3

Ah, it might be that this version is too low and I messed up the versions.json file. Can you try upgrading Obsidian to latest (re-downloaded installer) and try again?

celtickuma commented 1 year ago

No errors in the console:

Obsidian Developer Console plugin:longform:37057 [Longform] Starting Longform 2.0.3… plugin:longform:37145 [Longform] No workflows found; adding default workflow. plugin:longform:35569 [Longform] Loaded and watching projects. Found 0 drafts in 0.003s.

There is no data.json in .obsidian.plugins.longform. longform appears in .obsidian.community-plugins.json The test vault used a fresh installer picked at creation of the vault.

Vault Test135 zip file attached Test_135.zip

kevboh commented 1 year ago

@celtickuma did you update Obsidian to 1.1+?

kevboh commented 1 year ago

@celtickuma I don't understand the issue with the attached vault. It's an empty Index.md file—there is no Longform project there. What do you expect to load in Longform when opening this vault?

celtickuma commented 1 year ago

That is the Index file created by Longform in the created Longform project. I expected it to be a Longform Index file.
As I said. I did nothing manually here. That project and that Index file were created by right clicking on the folder and creating a project.

celtickuma commented 1 year ago

I will update Obsidian when I get a second. You did read the steps I called out in my comment, right?

Right click on folder Test Issue 135 Right-click on folder Click Create Longform Project Select Multi Enter Title: Test Issue 135_2_0_3 Click Create Verify new folder created Verify Index file created Verify metadata in Index file There is no metadata in Index file There is one word in the Index file: "Index"

celtickuma commented 1 year ago

Updated Obsidian to 1.1.9 Project created correctly. Index file contains correct metadata Copied project from 1.0.3 vault into new test vault Appears to work correctly. Closed Vault Quit Obsidian Started Obsidian Test vault opened as default Both projects (created and copied) appear to be correct As an aside, the projects do not show up (Longform pane is empty) when the vault created under 1.0.3 is opened by Obsidian 1.1.9

kevboh commented 1 year ago

As an aside, the projects do not show up (Longform pane is empty) when the vault created under 1.0.3 is opened by Obsidian 1.1.9

This is expected as the format has changed. See this guide.

You did read the steps I called out in my comment, right?

Yes, I did.

It seems like this was a version issue. I've updated versions.json in the repo, so this shouldn't happen in future.