adobe / da-admin

Apache License 2.0
0 stars 4 forks source link

Store version content automatically once in preparation for parsing change #39

Closed bosschaert closed 3 months ago

bosschaert commented 3 months ago

Description

In preparation for the parsing changes coming to da-collab https://github.com/adobe/da-collab/pull/38 and da-live https://github.com/adobe/da-collab/pull/38 store the content of a document automatically once.

Related Issue

6

Motivation and Context

Right now versions are only stored when a user explicitly requests this.

How Has This Been Tested?

Locally with da-live and da-collab.

Types of changes

Checklist:

codecov[bot] commented 3 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 86.26%. Comparing base (647e437) to head (7b65790). Report is 1 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #39 +/- ## ========================================== + Coverage 85.79% 86.26% +0.46% ========================================== Files 14 15 +1 Lines 915 968 +53 ========================================== + Hits 785 835 +50 - Misses 130 133 +3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

bosschaert commented 3 months ago

Thanks for the thoughts @auniverseaway . This would obviously be in addition to any explicit version creation operations. If you look at other document authoring systems they do seem to create versions automatically every now and then so that there is a history to go back through without the need for the user to explicitly create versions.

But I left the PR draft deliberately to have a discussion. Maybe previewing a document is enough of a cue for an additional version creation event.

karlpauls commented 3 months ago

Doing a version on a preview can be a client side feature - da-live can just invoke the version endpoint when it does a preview. I do think it would be a nice feature to automatically create a full version sometimes but we probably should make that configureable on an org level. @auniverseaway, maybe we can allow a property on the org to say that you want auto versions and in what intervals (where we for starters only support something like 'hourly' - the meaning would be: if a change comes in, we check if we have not taken a version in the last hour and if so, create one)?

bosschaert commented 3 months ago

With https://github.com/adobe/da-live/pull/110/commits/0dd88b0dfafcc56629b996b25a694d43b8a2548e#diff-2f1d9ac34dc38306a1ca727a924a5a2cf67637ab7390350fe2845a9ce524b5f3R44 I have implemented a version save on every preview.

bosschaert commented 3 months ago

Converting this one to draft, as we may not need this in the end.