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

Bug: Date Modified not updated if Lint done immediately after changes #1267

Open
2 of 3 tasks
zedtools opened this issue Feb 3, 2025 · 0 comments
Open
2 of 3 tasks
Labels
bug Something isn't working

Comments

@zedtools
Copy link

zedtools commented Feb 3, 2025

  • I have verified that I am on the latest version of the Linter

Describe the Bug

If I make changes to a file, and then trigger a Lint with CTRL+S, the Date Modified property is not updated.

How to Reproduce

Steps to reproduce the behavior:

  1. Configure settings:
    • Lint on save = on
    • YAML Timestamp
      • Date Modified = on
      • Date Modified Key = Modified
      • Date Modified Source of Truth = Changes in Obsidian
      • Update YAML Timestamp on File Contents Update = After 5 seconds
  2. Open a file and type some changes that satisfy all the Lint rules.
    • If I stop typing and wait 5 seconds, the Modified property is updated.
    • If I instead press CTRL+S (triggering a save + Lint), Modified is not updated.

Note that if the Lint modifies the file then Modified is updated as expected. However, the problem occurs if the file already satisfies all the Lint rules, so that the Lint does not modify the file. In this case, it seems that Linter forgets the file was previously modified.

Debug logs from Lint when CTRL+S pressed
Running linter
rules before regular rules: 0 ms
Running Convert Bullet List Markers
convert-bullet-list-markers: 1.2999999821186066 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Ordered List Style
ordered-list-style: 0.10000002384185791 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Unordered List Style
unordered-list-style: 0 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Empty Line Around Blockquotes
empty-line-around-blockquotes: 0.09999999403953552 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Empty Line Around Code Fences
empty-line-around-code-fences: 0 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Heading blank lines
heading-blank-lines: 0.20000001788139343 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Paragraph blank lines
paragraph-blank-lines: 0.19999998807907104 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Remove Empty Lines Between List Markers and Checklists
remove-empty-lines-between-list-markers-and-checklists: 0.800000011920929 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running Custom Regex
custom regex rules: 0 ms
Running Consecutive blank lines
consecutive-blank-lines: 0.09999999403953552 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

Running YAML Timestamp
yaml-timestamp: 0.30000001192092896 ms
---
Created: 2025-01-31T16:42:00+11:00
Modified: 2025-02-03T19:59:03+11:00
---

[[Test 2]]

Test content 1

rules after regular rules: 0.5999999940395355 ms
rules running: 3.7999999821186066 ms

Expected Behavior

If the file was modified by typing, then the Modified property should be updated after 5 seconds, regardless of whether a Lint was done in between.

Device

  • Desktop (both Mac and Windows)
  • Mobile
@zedtools zedtools added the bug Something isn't working label Feb 3, 2025
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