Skip to content

fix: Tasks in renamed files forgot about any properties/frontmatter values in the file #3005

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 11 commits into from
Aug 2, 2024

Conversation

claremacrae
Copy link
Collaborator

@claremacrae claremacrae commented Aug 2, 2024

Types of changes

Changes visible to users:

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

Internal changes:

  • Refactor (prefix: refactor - non-breaking change which only improves the design or structure of existing code, and making no changes to its external behaviour)

Description

Fix an unreported bug (in unreleased code)...

The actual fix is c09a884 - the rest is refactoring, initially to make the fix easy, and then to tidy it up a bit, with suggestions from @ilandikov.

Steps to reproduce:

Preparation

  1. Install the latest development build, for example from commit b42ead6
  2. Create a new note called test 2024-01-23
  3. Paste in this content:
---
custom_number_prop: 422
---

- [ ] #task Hellox
  1. Create a note called test query
  2. Paste in this content:
```tasks
description includes Hellox

group by path
group by function \
    `custom_number_prop: ==${task.file.property('custom_number_prop')}==`
group by scheduled
```
  1. View test query in Reading Mode. It should look like this:

Types of changes - 2024-08-02 21-19-24

Testing

  1. Rename test 2024-01-23 to test 2024-01-23 xxx

Expected result

a. The group by path heading gets xxx added
b. The custom_number_prop: heading value remains 422
c. The Backlink name gets xxx added

Types of changes - 2024-08-02 21-24-43

Actual result

a. ✅ The group by path heading gets xxx added
b. ❌ The custom_number_prop: heading value becomes NULL, not 422
c. ✅ The Backlink name gets xxx added

Types of changes - 2024-08-02 21-24-01

Motivation and Context

How has this been tested?

  • Automated tests
  • Exploratory testing

Screenshots (if appropriate)

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 003880c into main Aug 2, 2024
3 checks passed
@claremacrae claremacrae deleted the fix-frontmatter-lost-when-file-renamed branch August 2, 2024 20:38
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