dat-desktop icon indicating copy to clipboard operation
dat-desktop copied to clipboard

History view

Open okdistribute opened this issue 8 years ago • 10 comments

With the new SLEEP version, dat can download, save the changes, and revert to a previous point in history. It can also see a diff of which files changed. It could also see the content of the files that changed, but let's just have this iteration focus on looking at the history of changes and restoring to a previous point in time.

Here are some examples:

Restore to earlier version image

While a file is open image

Table view image

GitHub history

image

GitHub Desktop App

image

okdistribute avatar May 02 '17 18:05 okdistribute

cool, thanks for sharing!

yoshuawuyts avatar May 04 '17 12:05 yoshuawuyts

Example from Dropbox:

image

Kriesse avatar May 23 '17 07:05 Kriesse

DAT creates a lot of versions in a short time. It would be good to allow a DAT client to have some sort of "bundled versions" that act a little bit like Keyframes in Movies. Is there a system for this in place?

martinheidegger avatar Nov 09 '18 08:11 martinheidegger

Beaker-browser implements versions like this:

https://github.com/beakerbrowser/beaker/blob/37981f57d5c6f30aab0f94b72213d9505c272d78/app/builtin-pages/views/library-view.js#L685-L803

screen shot 2018-11-16 at 20 51 20

martinheidegger avatar Nov 16 '18 11:11 martinheidegger

For me the name version is a bit misleading, or it's not what I would expect as a user.

The current version history, that dat log returns is in my opinion limited useful: it can grow very long easily but does not provide much information beyond individual file changes. I would more expect something like git log.

dkastl avatar Nov 17 '18 02:11 dkastl

https://github.com/datprotocol/DEPs/pull/5#issuecomment-439130827

Version: Internally every dat data-structure is composed of append-only logs (hypercores). Any time an entry is appended to the log, a new version is created. The version is identified according to the semantics of the data-structure. In the case of single-writer hyperdrive, it's currently being identified by the metadata log's latest message number.

martinheidegger avatar Nov 17 '18 04:11 martinheidegger

I'd probably say this feature's main purpose is historic lookup. In conversation with Martin, it came out that the meaning of "version" is technically "history of file operations".

But is this really user-friendly?

Maybe: "Time based version" is better?

Every version entry also has metadata with a timestamp. So, we can show squashed versions based on their timestamps. (i.e. chunks that happened within 5 minutes get squashed)

Users could also configure the time-span. (It would behave a little bit like a financial chart)

(This could probably done in the frontend alone, without changes on the DAT data)

AtuyL avatar Nov 17 '18 10:11 AtuyL

Regarding the time-stamps: In distributed systems "timestamps" are not trust worthy. They can be seen as rough estimates around which time the version probably happened.

In Git it usually works out in practice but its not reliable.

However: much more problematic about using time-stamps is that dat-log (that uses append-log) only stores the date of "put" operations in the "last-modified" metadata. Delete is not stored!

Related: https://github.com/mafintosh/append-tree/issues/16

martinheidegger avatar Nov 17 '18 11:11 martinheidegger

Thank you for clearing this up.

My suggestion required a timestamp of Delete and put. 😭 Need to rethink it...

AtuyL avatar Nov 17 '18 12:11 AtuyL

Note: I've proposed self-reported timestamps (git style) to be included in hyperdb/hyperdrive:

  • https://github.com/datprotocol/DEPs/pull/11
  • https://github.com/bnewbold/dat-deps/blob/dep-hyperdb-timestamps/proposals/0000-hyperdb-timestamps.md

bnewbold avatar Nov 17 '18 21:11 bnewbold