dendron icon indicating copy to clipboard operation
dendron copied to clipboard

incorrect note created on lookup (+ possible race condition?)

Open nikhiljha opened this issue 3 years ago • 3 comments

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
  • [x] 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

Sometimes, when I type note.that.doesnt-exist into dendron, it'll create a note with a truncated title (e.x. note.that.doesnt-exi. When I try to rename the note, it says note.that.doesnt-exist already exists.

To Reproduce

  1. Create a new note with Lookup, but type really fast.
  2. Try to rename the note (if it gets named incorrectly).

Expected behavior

Either...

  1. The note gets created with a correct title the first time.
  2. The note gets created with an incorrect title, but can be renamed.

Screenshots

Next time I run into the renaming thing I can take a screenshot.

Desktop (please complete the following information)

  • OS: MacOS 12.4
  • Versions (all that apply to bug):
    • Dendron Extension: v0.98.0
    • VS Code version: 1.68.0

Dendron Log file

Have since restarted VSCode, I'll attach this when I see it.

nikhiljha avatar Jun 11 '22 05:06 nikhiljha

Thank you for the report @nikhiljha. We have recently made some tweaks to the lookup command so that this happens a lot less. As far as I'm aware, there are multiple reasons this happens, so we'll keep track of this issue and let you know when we fix it.

@jonathanyeung, pinging for visibility. Does the recent fix resolve this issue?

hikchoi avatar Jun 14 '22 12:06 hikchoi

Hmm, the recent fix I made should address latency at the leading edge of the query, for example te.that.doesnt-exist. I made a fix several months ago that should help with the trailing edge problem, but I haven't seen this issue since then.

@nikhiljha - how often does this repro for you? I'll keep an eye out and revisit the code.

jonathanyeung avatar Jun 17 '22 08:06 jonathanyeung

Okay so I wasn't able to reproduce this since filing this issue, until today.

If you have the "Spell Right" plugin installed (which I believe is workspace recommended?) and then type a really long line (paragraph length), then future inputs on that line become very high latency. (I can type a sentence and it'll appear 20 seconds later).

Once VSCode is lagging like that I can consistently get this bug to trigger. I'm not sure if this is just my machine, but I have very normal standard hardware (M1 Mac) so I'd be surprised if it was just me.

nikhiljha avatar Jul 07 '22 06:07 nikhiljha