Bug with files:scan directory timestamps

So it seems this bug has been around for a long time. I hear Nextcloud has changed a LOT since 2016 when this was first reported, and even since 2018 when the first comment describes exactly this issue. Maybe the issue is considered stale because of its age…
(occ files:scan -all Makes all folders show that they were just changed. · Issue #1583 · nextcloud/server · GitHub)

I was able to access my Snap’s MySQL using sudo nextcloud.mysql-client
(GitHub - nextcloud-snap/nextcloud-snap: ☁️📦 Nextcloud packaged as a snap).

The oc_filecache table (which I think is the primary file index for Nextcloud?) has two columns for Modified time: mtime (displayed to the user) and storage_mtime (matches the real files). When Nextcloud scans new folders, it correctly scrapes the storage_mtime then incorrectly uses the scan time as the mtime. So I ran the following SQL to correct all of Nextcloud’s timestamps. As far as I can tell, this worked fine and didn’t cause any secondary issues.
UPDATE oc_filecache SET mtime = storage_mtime;
(What is the purpose of the storage_mtime column in oc_filecache table?)

It’d be cool to hear from anyone who knows why Nextcloud deliberately tracks and displays a Modified time other than the true time on the file.

Also, this is making me rethink my backup strategy… I assumed Nextcloud was quite robust in keeping its database in sync with the underlying files. But in researching this problem, it seems that files:scan only adds new files, and files:cleanup only removes links between a cache table and file list table. I believe there is no mechanism to bring the Nextcloud database 100% into sync with the underlying filesystem. Please comment below if this is wrong, I’d love to know how to do this.
(Using the occ command — Nextcloud 15 Administration Manual 15 documentation)

Therefore, I might try taking atomic snapshots of the entire Nextcloud server so that I can roll back my files & the database to a known point, since it’s not really possible to resync Nextcloud after rolling back a subset of files alone.

Dan