Menu

#121 Don't restore deleted history entries during sync

KeePass_2.x
open
nobody
None
5
2020-04-13
2020-01-18
Rookiestyle
No

This patch will ensure that deleted historic version of an entry will not be added again during synchronization.

As of now, KeePass will merge all historic versions in both databases, deletions of historic versions will be undone with a merge.
With this patch KeePass will behave as follows:

Merge method is not Synchronize
All historic versions in both databases will continue to be merged, there is no change here.

Merge method is Synchronize
Historic versions will only be merged if they are
Contained on both sides (source and target) already
OR
if it's a historic version on source side AND this historic version is newer than the target's most recent historic version

Example
Your entry is V4 and in your two databases A and B do contain the historic versions V1, V2 and V3.
Today morning, you create a V5 in A and you delete V2 in A as well.
Today afternoon, you create a V6 in B and you delete V3 in B as well.
Today evening, you create a V7 in B.

After you sync A and B, both will show V7 as active version and both entry's history will contain V1, V4 and V6.
V2 will be deleted from B because it was activeley deleted from A.
V3 will be deleted from A because it was actively deleted from B.
V5 will be deleted from A because it was never synched to B and B contains the newest version of the entry (similar to V3, not available on source side and spurce is neweer than target)
V6 will be added to the history in A because it was historized in B after the last change of the entry in A

I decided to change the behaviour of merge method Synchronizeinstead of defining a new one.
It would be easy to add an option like 'Enable aggressive sync'.

1 Attachments

Discussion

  • Paul

    Paul - 2020-01-19

    I like the concept but it should be optional - set in Options.

    "historized"!? That's almost worse that "expiration" (expiry existed long before someone decided we needed a longer word).

    cheers, Paul

     
  • Rookiestyle

    Rookiestyle - 2020-03-07

    Added an option for this new way of synchronizing.

    Default value is off, it needs to be enabled explicitly

    Update: Adjust XmlSerializerEx.Gen.Cs

     
    👍
    1

    Last edit: Rookiestyle 2020-04-11
  • Phil

    Phil - 2020-03-08

    So, when will this be implemented? :D

     
  • Paul

    Paul - 2020-03-09

    No guarantee that any suggestions will be implemented.

    cheers, Paul

     
  • T. Bug Reporter

    T. Bug Reporter - 2020-04-12

    Why not repackage this as a plugin?

     
  • Rookiestyle

    Rookiestyle - 2020-04-12

    This cannot be done using a plugin.

     
  • T. Bug Reporter

    T. Bug Reporter - 2020-04-12

    Could you please explain why not? I'm trying to understand what plugins can or can't do, as a prelude to building some of my own.

     
  • Rookiestyle

    Rookiestyle - 2020-04-12

    KeePass' plugin framework allows for very powerful plugins that can customize KeePass' behaviour to a large extent. Still, plugins can't do everything.

    Plugins can use any of the available public (and private) methods of KeePass, changing the code inside those methods is not possible.

    It is possible to add a menuitem like "Special sync" and do the entire stuff as part of the plugin itself. Unfortunately this won't play well with other plugins that offer synchronizing with e.g. Google Drive, Onedrive, ... as these plugins still use the unchangable KeePass methods.
    That's not what I want to achieve. I consider it benefitial to change the way KeePass does synchronizing and still be able to use any of the existing sync plugins.

    Think of KeePass like a car.
    You can change the speed by using public methods like gas pedal or brake pedal.
    You can also - with some effort - directly call methods like clock_the_carto change the mileage.
    You can not change the way the engine itself works, unless you dissassemble everything and change the way it's built.

     

    Last edit: Rookiestyle 2020-04-12
  • T. Bug Reporter

    T. Bug Reporter - 2020-04-13

    So I guess that means my ideas to restore and/or rework the "custom colored icon" functionality aren't going to be doable, either. Bummer. :-(

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.