Document is dirty after undo

Having trouble installing Oxygen? Got a bug to report? Post it all here.
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Document is dirty after undo

Post by shilpa »

Hi Team,

I am working on web author and I edited the document and made undo of the changes which i made even though document is dirty showing dirty.
Is there any way to check after undoing the edited changes the document should not be dirty ?

please help on this..

Thanks & Regards
Shilpa.P
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Re: Document is dirty after undo

Post by shilpa »

Hi Team,

It would be helpful if you provide any update for this query.

Thanks & Regards
Shilap.p
mihaela
Posts: 393
Joined: Wed May 20, 2009 2:40 pm

Re: Document is dirty after undo

Post by mihaela »

Hello,

Can you please provide some clear steps to reproduce this problem? A sample document and simple steps would be very helpful (describe the changes that you make, if the concurrent editing is activated and any other details).
Can you reproduce also on our demo server[1]?

[1] https://www.oxygenxml.com/oxygen-xml-we ... xygen.html

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Re: Document is dirty after undo

Post by shilpa »

Hi Miheala,

Say suppose i have edited the document , now the document got dirty.
and as soon as i edited the document it calls below function and i will get true.
goog.events.listen(workspace, sync.api.Editor.EventTypes.DIRTY_STATUS_CHANGED, function(e) {
console.log(e.isDirty);
});

Now suppose i have undo the changes which i made then above function is not calling and still document is dirty in this case document should ne be dirty as i have undo my changes.
After few seconds above function will call and make document non-dirty.

But for me as soon as i made undo document should get non-dirty how to achieve that?
mihaela
Posts: 393
Joined: Wed May 20, 2009 2:40 pm

Re: Document is dirty after undo

Post by mihaela »

Hello,

Thank you for the details. We tested and there are indeed situations when the document is not set as non-dirty after undo. The DIRTY_STATUS_CHANGED event that appears after a few seconds I think is triggered by autosave (the document becomes non-dirty again after save). I will add an issue in our internal issues tracking system to set the document as non-dirty after undoing all changes. We will update this thread after this improvement will be available.

Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Re: Document is dirty after undo

Post by shilpa »

Thank you Mihaela for the update..

We hope will get this issue resolved ASAP. As we are are moving to prod in next month.

Thanks & Regards
Shilpa.P
mihaela
Posts: 393
Joined: Wed May 20, 2009 2:40 pm

Re: Document is dirty after undo

Post by mihaela »

Hello,

Can you please give us more details about your use case? Why is so important for you if the document is marked as non-dirty after the last undo? Is there any operation that you must do in this case?

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Re: Document is dirty after undo

Post by shilpa »

Yes Mihaela after editing the document we will do document check -in. In check-in functionality we check is document dirty if yes we will compare old version xml with edited xml and create new version.

Here actually after undo also document is dirty so comparing xml functionality is failing.
if document becomes non-dirty after undo then it would be easy for us to know that check-in is not required as document is not modified.

Thanks & Regards
Shilap.P
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Re: Document is dirty after undo

Post by shilpa »

Hi Mihaela,

I hope will get this issue resolved by ASAP.
We have kept this issue open in our side.

Thanks & Regards
Shilap.P
mihaela
Posts: 393
Joined: Wed May 20, 2009 2:40 pm

Re: Document is dirty after undo

Post by mihaela »

Hello,

We understand that you need to solve this as soon as possible so maybe we should discuss in more detail the problems you encounter. Please write us at support@oxygenxml.com with details about the situation when the comparing XML functionality is failing if the document is saved (what is the error that you obtain?).

Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
shilpa
Posts: 45
Joined: Mon Jul 04, 2022 8:42 am

Re: Document is dirty after undo

Post by shilpa »

Hi Miheala,

Comparing XML failing is our internal function not the oxygen XML comparison.
Actually we compare current document with the previous version document which is present in our DB.
When we do not find any changes then we throw error.

So when we do undo in oxygen still it is behaving as document is dirty that should not happen.
Immediately after undo if document becomes non dirty then our internal function we will not call as its not dirty document.

Thanks & Regards
Shilpa.P
Bogdan Dumitru
Site Admin
Posts: 71
Joined: Tue Mar 20, 2018 5:28 pm

Re: Document is dirty after undo

Post by Bogdan Dumitru »

Hello Shilpa,

Regarding your affirmation "when we do not find any changes then we throw error" - we understand that you have your own diff solution, different than the one within Web Author, a solution that breaks when the documents are equal. We kindly suggest considering fixing your solution too so that it won't throw an error when the documents are equal, if possible and feasible of course.

Regarding the problem you reported in the Web Author, where the document would wrongly appear as dirty after an undo, considering that you have a release deadline soon, we've managed to create for you a plugin that fixes the dirty status behaviour.
Download the zip with the plugin inside from here [0], extract it, and just install the plugin and see that whenever the content of the document is the same as the one saved, the dirty status vanishes immediately.
Note that the plugin may slow the editing of big documents in some specific cases.

[0] https://www.oxygenxml.com/userFiles/145 ... 092303.zip
Bogdan Dumitru
http://www.oxygenxml.com
Post Reply