Viewing a note causes to reset modified date

What I’m trying to do

In the Live Preview mode on the active tab, clicking on a note to view. Without editing it, as soon as I click on another note, the modified date of the note I just left gets reset to “now” and the note jumps to the top of my list (because I sort by the modified date). This messes up my notes order and I’m unable to use Obsidian at the moment as more and more mdates are being lost. I can’t rely on constantly remembering to switch from Live Preview to Reading mode every single time I switch between notes, so I need a better solution.

Things I have tried

I found a similar attempted bug report about Obsidian force-modifying notes that came from 3rd party editors. However I’m not using 3rd party editors. The entire new content was just migrated from Evernote to Obsidian using Yarle (the built-in importer failed on metadata). But I don’t see other people having the same issue after using Yarle migration. I have other test vaults with content migrated in the same way and in the same location, it happens in some of those vaults or folders but not the others, and I can’t see a pattern. So it does seem like a bug.

I’m also aware of community plugins that let me switch to the frontmatter date instead of the filesystem mdate, but at this point I just need the basic functionality of editing and sorting notes. I prefer to stick with the built-in functionality and sidebar, and avoid things like Linter bulk-editing my content.

Hi, welcome to the forums and to using Obsidian! :slight_smile:

Go to Obsidian Settings → Community plugins, then in the first row (“Restricted mode”), click on the “Turn on and reload” button, then test again. This will help narrow down if there’s any community plugins auto modifying your notes, which is likely what’s happening here. This is not usual behavior.

Also, what OS you use, and what’s your Obsidian version (Settings → General)?

Yes, it’s definitely a third party plugin (or a standalone script) and when picking a plugin to update mdate stamp, make sure you use one that only changes stamps when you actually write/type in to edit the file.

AlanG’s plugin can be configged to do this:

If it still does it, after using this plugin, then you may have downloaded or use a DV(Js) or similar script. Can’t say from where I’m sitting.

To be clear, there are no community plugins on the vault that is doing it, not even an importer, and the restricted mode is on. Like I said, I found a similar bug report, see “Viewing a file with different line endings causes file to save with new line endings” in the bug graveyard forum. There are a couple of other posts that discuss general unreliability of relying on the system mdate, for example see “What implementation of time-based workflow is to be followed – system ‘mtime’ or ‘date modified’ frontmatter values?

I observe that once this forced modification of the mdate was done once to a previously migrated note, it does not seem to happen on the note again, after that the note behaves normally. It’s still a big problem for me because I’ve already lost the previously correct modification date that came with my migrated note.

But this does agree with the above bug report that Obsidian maybe doing a one-time formatting fix of Yarle output. I think I need to ask the Yarle developer/team about this - anyone can tell me who he/she is on this forum?

I’m on Windows and the latest Obsidian downloaded a few days ago. I’m just getting started. I hope that this is an explainable issue, and not a confirmation of “Obsidian does not work well with mdates, the frontmatter is the only way” opinions out there. I would prefer to stay with the built-in Obsidian functionality for now before I move on to community plugins and alternative solutions.

Oh, I misunderstood.
Well, Obsidian auto-saves files every two seconds or so I remember. Not sure if that only kicks in if you type or makes changes…apparently, not?

This is why people use custom dates in YAML frontmatter which the aforementioned plugin can help with and then of course you Dataview or Bases queries need to be querying these custom props.

UPDATE: I just ran windows fc in the command line on an original and the modified-mdate note files, and it found no differences. So it seems no formatting fix is being done, just the mdate. Which is not good news.

Ok, so let me understand this - the built-in Obsidian functionality uses system mdates. Is it normal behavior what is happening here, auto-saving even if no edits have been made? Is it the official Obsidian answer that using mdate does not represent actual edits made to the note, and date-based sorting should not be used for that reason?

I wonder if I can invite the Obsidian team to comment on this topic. I’m kind of stuck here because the chronological order of my notes is absolutely essential to me.

You can read from here:

Also, you need to say where you are files are located as it may be the sync you are using not Obsidian.

And yes, you will have full control with custom YAML properties and optionally, templates.

I hear you about the YAML and I will go with the custom plugin route if I have to, just trying to understand the Obsidian position on this. Seems strange the most basic functionality of mdates gets broken so easily before I even started using it. I’m inviting @WhiteNoise from support to comment.

I found another post on this issue here, and the Obsidian support is stating it’s a one-time formatting fix as I initially suspected. However I did the fc compare on both files as I explained in the previous post, and it found no differences in my case, so I’m not certain it’s the same issue here.

My files are on a local disk in Windows, nothing special.

UPDATE: looks like it’s the Obsidian auto-fix of the line endings after all. When I open the original and modified files in an editor that allows me to see all hidden symbols, I see that Obsidian replaced CRLF generated by Yarle with LF, which I assume is what Obsidian wants.

So my immediate next problem is that I cannot see a setting in Yarle that would allow me to force it generate LFs during the conversion. Are there Yarle experts here that could help? If I cannot force Yarle to generate LF, I need a separate step to bulk-replace all CRLF with LF in all my notes while preserving the modified dates, which would require some advanced file processing tool.

And my upcoming question: if Obsidian is so sensitive to line endings and other formatting nuances, will I have cross-platform compatibility when I start syncing notes between Windows and Android apps, for example?

CRLF issues also happen arround git syncing (Win vs Unix systems), which is the most reliable type of syncing regarding mtime retention, according to chatbot answer:

https:// chatgpt.com/ share/6960b5fc-85a0-8007-ab47-b14c97af320f

(for general brainstorming purposes only)

Post edited.

We know you are trying to help, but please don’t post chatbot answers in this forum. Thanks!

On Discord, we have an trigger-response:

@user Thanks for trying to help! However, asking ChatGPT or any other LLMs (Large Language Models) is discouraged in our community because their responses often contain outdated information or straight-up misinformation. If you don’t know the answer, that’s fine! Other community members can help with unanswered questions.

2 Likes

Sorry, noted.

The main idea behind use of it was prodding the forum poster toward finding a solution when moderator responses were unavailable (even after pinging, which I know is against rules).

BTW, interesting, now this link brought to attention by OP above didn’t get enough views and generated more user activity.

Thank you!

Outside of the social implications, I’m not anti-chatbot for personal use.

“What’s salmon in rgba for use in css”? “Format this as an unordered list”, etc., great, well done.

We just don’t want folks replying with answers using it. I think you understand. Thanks.

I didn’t know mentioning the support team was against the rules (I don’t see forum rules pinned anywhere). I need the support help because I expected this to be a very common issue and yet no answers. Lots of people convert from Evernote to Obsidian. A lot of these people must be using Yarle because the Importer plugin seems to be broken and not importing all the metadata.

To summarize the problem:

  • Yarle converter generates CRLF line endings
  • Obsidian replaces CRLF with LF automatically whenever you are viewing a note without editing it, which resets the modified dates and destroys the chronological order

Shouldn’t this have been encountered and solved dozens of times by now, but I’m not finding any solutions yet. I’m aware of the community plugins and frontmatter dates solution, but I’m asking how to stay with the core functionality for now. Hoping for someone from support to see this.