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

Very weird bug on importing markdown #3735

Open
1 of 7 tasks
PabloLION opened this issue Oct 30, 2022 · 3 comments
Open
1 of 7 tasks

Very weird bug on importing markdown #3735

PabloLION opened this issue Oct 30, 2022 · 3 comments
Labels
type.bug Something isn't working

Comments

@PabloLION
Copy link
Contributor

PabloLION commented Oct 30, 2022

Please select the area your bug applies to. (Multiple selections are Possible. You can leave blank if you're not sure.)

  • Workspace. VSCode workspace, vaults, Intellisense/autocomplete, Dendron settings
  • Lookup. Dendron's Lookup Command
  • Views. Dendron Preview, Tree View, Side Panels in the UI
  • Schema. Dendron Schemas
  • Pod. Data import from / export to Dendron
  • Publish. External Site Publish
  • Markdown. Markdown features, such as syntax support and features

Describe the bug

When I don't know how to describe, I use "weird" src: /Users/pablo/LocalDocs/failing

To Reproduce

Steps to reproduce the behavior:

  1. Set ./pods/dendron.markdown.config.import.yml to below. Alternatively, use command palette Dendron: Import Pod -> dendron.markdown to create the file

    src: ~/failing-import-test
    vaultName: test-vault
  2. add a file to the import source from my gist dendron-import-bug.md

    mkdir ~/failing-import-test
    curl https://gist.githubusercontent.com/PabloLION/2fcf9d21b49ebb8f0b915d6a5481e42a/raw/ > ~/failing-import-test/dendron-import-bug.md
  3. Try to run import with command palette Dendron: Import Pod -> dendron.markdown

Expected behavior

The file being imported correctly.
The weird thing is adding a "line break" in the file anywhere before line around (line number 1838) resolves the problem, and adding an "line break" after that line keeps the error.

Screenshots

dendron-import-bug

Desktop (please complete the following information)

  • OS: macOS 12.6 (21G115)
  • Versions (all that apply to bug):
    • Dendron Extension: 0.116
    • VS Code version: 1.72.2

Additional context

The gist I used, dendron-import-bug.md, is generated by some logger and I removed most of the daily chars in ASCII like abcd1234.

Dendron Log file

Please attach the output of > Dendron:Dev: Open Logs here

{"level":30,"time":1667088573218,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"ReloadIndex.execute","msg":"enter"}
{"level":30,"time":1667088573228,"pid":60074,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"logger","ctx":"parsingSchemas","fname":"root","root":{"fsPath":"dependencies/localhost/test-vault","selfContained":true,"name":"test-vault"},"imports":[]}
{"level":30,"time":1667088573229,"pid":60074,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"logger","ctx":"parsingSchemas","fname":"root","root":{"fsPath":".","selfContained":true,"name":"Dendron-1"},"imports":[]}
{"level":30,"time":1667088574414,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"ReloadIndex.execute","durationEngineInit":1194}
{"level":30,"time":1667088574414,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"ReloadIndex.execute","msg":"exit"}
{"level":30,"time":1667088574414,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.importPod:run","msg":"post-execute"}
{"level":30,"time":1667088576101,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WorkspaceWatcher:onWillSaveTextDocument","url":"/Users/pablo/failing-import-test/dendron-import-bug.md","reason":"Manual","msg":"enter"}
{"level":30,"time":1667088579374,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WorkspaceWatcher:onWillSaveTextDocument","url":"/Users/pablo/failing-import-test/dendron-import-bug.md","reason":"Manual","msg":"enter"}
{"level":30,"time":1667088582225,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.importPod:run","msg":"pre-execute"}
{"level":30,"time":1667088582225,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":{"ctx":"ImportPod"},"msg":"enter","podChoice":"dendron.markdown"}
{"level":30,"time":1667088582232,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"ImportPod","ctx":"MarkdownPod","wsRoot":"/Users/pablo/Dendron-1","src":"/Users/pablo/failing-import-test","msg":"enter"}
{"level":30,"time":1667088582234,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"ImportPod","msg":"done collecting items"}
{"level":30,"time":1667088582234,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"ImportPod","ctx":"MarkdownPod","wsRoot":"/Users/pablo/Dendron-1","numItems":2,"msg":"collectItems"}
{"level":50,"time":1667088582891,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.importPod:run","error":{"name":"DendronError","status":"unknown","payload":"{}","innerError":{}}}
{"level":30,"time":1667088587738,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.importPod:run","msg":"pre-execute"}
{"level":30,"time":1667088587738,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":{"ctx":"ImportPod"},"msg":"enter","podChoice":"dendron.markdown"}
{"level":30,"time":1667088587742,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"ImportPod","ctx":"MarkdownPod","wsRoot":"/Users/pablo/Dendron-1","src":"/Users/pablo/failing-import-test","msg":"enter"}
{"level":30,"time":1667088587743,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"ImportPod","msg":"done collecting items"}
{"level":30,"time":1667088587743,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"ImportPod","ctx":"MarkdownPod","wsRoot":"/Users/pablo/Dendron-1","numItems":2,"msg":"collectItems"}
{"level":50,"time":1667088588400,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.importPod:run","error":{"name":"DendronError","status":"unknown","payload":"{}","innerError":{}}}
{"level":30,"time":1667088640570,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WindowWatcher:onDidChangeVisibleTextEditors","editorPaths":[]}
{"level":30,"time":1667088640570,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"refreshBacklinksChangeActiveTextEditor"}
{"level":30,"time":1667088640636,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WindowWatcher:onDidChangeVisibleTextEditors","editorPaths":["/Users/pablo/Dendron-1/dependencies/localhost/test-vault/notes/dendron-import-bug.md"]}
{"level":30,"time":1667088640638,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"refreshBacklinksChangeActiveTextEditor"}
{"level":30,"time":1667088640651,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WorkspaceWatcher:onFirstOpen","msg":"enter","fname":"dendron-import-bug"}
{"level":30,"time":1667088641929,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WorkspaceWatcher:onFirstOpen","msg":"exit","fname":"dendron-import-bug"}
{"level":30,"time":1667088643186,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"WindowWatcher:onDidChangeActiveTextEditor","editor":"/Users/pablo/Dendron-1/dependencies/localhost/test-vault/notes/dendron-import-bug.md"}
{"level":30,"time":1667088645848,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"updateDecorations","payload":{"decorationsLength":90,"diagnosticsLength":0}}
{"level":30,"time":1667088772880,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.dev.openLogs:run","msg":"pre-execute"}
{"level":30,"time":1667088772880,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"execute","opts":{}}
{"level":30,"time":1667088772880,"pid":60030,"hostname":"Pablo-LIONs-Mac-Studio.home","name":"dendron","ctx":"dendron.dev.openLogs:run","msg":"post-execute"}
@github-actions github-actions bot added status.triage-needed type.bug Something isn't working labels Oct 30, 2022
@PabloLION
Copy link
Contributor Author

When I'm trying to import my old notes with "Import Obsidian Vault", I saw this error...

error: {"ctx":"dendron.importObsidianPod:run","error":{"stack":"RangeError: Maximum call stack size exceeded\n
at Object.iterator (~/.vscode/extensions/dendron.dendron-0.116.0/dist/extension.js:8:3477764)\n
at Object.o (~/.vscode/extensions/dendron.dendron-0.116.0/dist/extension.js:8:3479817)\n
at Object.i (~/.vscode/extensions/dendron.dendron-0.116.0/dist/extension.js:8:3480492)\n
at Object.i (~/.vscode/extensions/dendron.dendron-0.116.0/dist/extension.js:8:3480541)\N
REPEATING LAST LINE FOR 100 TIMES
at Object.i (~/.vscode/extensions/dendron.dendron-0.116.0/dist/extension.js:8:3480541)\n
at Object.i (~/.vscode/extensions/dendron.dendron-0.116.0/dist/extension.js:8:3480541)","message":"error while running command: Maximum call stack size exceeded","name":"DendronError","status":"unknown","payload":"{}","innerError":{}}}

I see it's a minified version, I'm trying to read https://github.com/dendronhq/dendron/blob/874459c397a5b89cb3203b2d4865c30a5beab917/packages/plugin-core/src/_extension.ts
but how can I know where's the mistake..? Is there an option for the js-ts map?

@hikchoi
Copy link
Contributor

hikchoi commented Oct 31, 2022

Thank you for the report.

but how can I know where's the mistake..? Is there an option for the js-ts map?

dist/extension.js in the trace doesn't map to _extension.ts.

@jonathanyeung @Harshita-mindfire can you take a look?

@PabloLION
Copy link
Contributor Author

Yea.. thing is I don't know much about debugging the VCSE with TS file. I've tried to find the origin of the problem but I can't find it.

If we cannot fix the bug, can we add a try..catch to skip the rotten file and log+notify the file name? Maybe with a similar UI to the refactor function.
Why try..catch: With this bug, if the markdown files being imported includes one malformed markdown like the gist I posted, the whole import process would break down. In my experience, I had to locate which file was rotten manually. I once thought the import pod was unstable (I had two rotten files) but finally I was able to create an MRE for the issue.

Anyway, I've moved all my old notes to the dendron and I've fully embracing my new garden now😆 so it doesn't obstruct me at all.

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

No branches or pull requests

2 participants