If we generate a new version then the user may get confused when comparing the versions. Seeing "No changes" when comparing two consecutive versions of a page can make the user loose his trust in the diff: "There must be some change that the diff doesn't detect because otherwise I wouldn't have two versions". I think we should keep the current behavior but we should improve the status displayed after the import. Besides the list of pages that have been imported (saved with a new version) we can have a list of pages that have been skipped (because there were no changes). Or we could mark the skipped pages distinctly in the list of imported pages. I think the users will appreciate this, especially since it allows them to see clearly what pages have really been changed by the import. Thanks, Marius On Wed, Feb 8, 2017 at 3:33 PM, Thomas Mortagne <[email protected]> wrote:
Hi devs,
We have a unintended regression in the standard import: if what you import is identical to what is already in the database (including the author) it won't add a new version (if you use the default option "Add a new version to the existing page").
What happen in practice is that if you keep calling XWikiDocument#set* methods with the same data it won't update the metadata or content dirty flags. This flags are what hibernate store look at to know if it should add a new version or not.
You can reproduce the same behavior with a simple script which load a document, always set the same content and save. You will notice that the history of that document does not change.
So the question is do we force metadata dirty to true all the time in the instance output filter or do we keep this feature (in which case we should optimize it a bit to not do the useless XWiki#saveDocument but that's another subject).
WDYT ?
It could be seen as a nice feature but in practice my first reaction was WTF and you often want to be sure the import actually did something so I'm +1 to force metadata dirty. But I'm +0 to keep the current behavior if there is a majority for it.
-- Thomas Mortagne