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

Race condition in Capture thought feature with context selection #30

Closed
zachmueller opened this issue Oct 8, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@zachmueller
Copy link
Owner

I realized there is a race condition that can occur when using the Capture thought functionality while having multiple Contexts set in the settings. In this setup, the user gets prompted immediately after the new note is created by the Capture thought flow to select the context to apply to the note. If the user selects a context too quickly, the frontmatter properties of the new note end up getting overwritten (sometimes a property or two might survive, but in some test cases I found none of them did).

I suspect the issue arises right around this section of the code. I need to try adding in some sort of check to validate the new note is "at rest" and fully created prior to running the following steps of the flow.

@zachmueller zachmueller added the bug Something isn't working label Oct 8, 2024
@zachmueller
Copy link
Owner Author

From some further testing, this may only arise in the case of vaults containing a large number of notes. I first saw this bug in my own real vault, which has ~2,300 notes but when I tried to replicate the error in my test vault (with only ~10 notes) I couldn't ever select the context fast enough to create the same race condition. This makes sense as it's likely related to the metadata cache update occurring on the new note.

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

No branches or pull requests

1 participant