Skip to content

fix: Editing properties/frontmatter now updates Query results #3003

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

Merged
merged 15 commits into from
Aug 2, 2024

Conversation

claremacrae
Copy link
Collaborator

Types of changes

Changes visible to users:

  • Bug fix (prefix: fix - non-breaking change which fixes an issue)

Internal changes:

  • Tests (prefix: test - additions and improvements to unit tests and the smoke tests)

Description

Task objects are now updated if the frontmatter in the file containing them is edited.

Motivation and Context

This fixes an unreleased bug, that editing properties/frontmatter did not update Tasks query results. This matters now that properties/frontmatter can be used in Tasks queries.

The steps to reproduce the bug are:

  1. Install development version of Tasks plugin
  2. Create a note called test
  3. Paste in this content:
---
custom_number_prop: 42
---

```tasks
path includes {{query.file.path}}
group by function task.file.property('custom_number_prop')
```

- [ ] #task Hello
  1. Preview the results. It should show this:

image

  1. Use the 'File properties' panel to edit the property value from 42 to 43

Expected result

Group heading changes to 43:

image

Actual result

Display is unchanged until edits are made to the task line in the file, or Obsidian is restarted.

How has this been tested?

  • TDD addition of automated tests for the fix
  • Manual exploratory testing, confirming that the steps recorded above now work

Checklist

Terms

@claremacrae claremacrae added the scope: parsing markdown See also 'scope: global filter' label Aug 2, 2024
Copy link

sonarqubecloud bot commented Aug 2, 2024

@claremacrae claremacrae merged commit 3cd5ca2 into main Aug 2, 2024
3 checks passed
@claremacrae claremacrae deleted the fix-frontmatter-updates branch August 2, 2024 10:28
claremacrae added a commit that referenced this pull request Aug 2, 2024
SonarCloud pointed out that in #3003 I had increased the complexity in
Task.identicalTo() from 15 to 16.

By this change, and extracting Task.recurrenceIdenticalTo() it should have dropped
to below 15 now.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: parsing markdown See also 'scope: global filter'
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant