ARK-Builders / arklib

Core of the programs in ARK family
MIT License
1 stars 10 forks source link

"First discovered" attribute of resources #66

Open kirillt opened 2 years ago

kirillt commented 2 years ago

Usually, for sorting by "date" timestamp "last modified" is used. This timestamp comes from common filesystems and means last time file was modified, but also it can be updated without actual content modification. And in case of such modification, our app considers the resource to be the same due to usage of content-addressing. Our app is also supposed to be used in distributed setup (at this moment, by using external syncing app like Syncthing). When a resource is replicated to other devices, all replicas have different "last modified" attribute.

It makes more sense for a user to think about resource creation time. Some filesystems has "created" timestamp, but such a timestamp would be reset every time the user moves the resource. We can provide semantically similar attribute "first discovered" which would mean the time when the resource was first time indexed by any of our apps on any of the user's devices.

This timestamp should be stored in the (persisted and replicated) index, so it would be propagated to other devices.