iTop icon indicating copy to clipboard operation
iTop copied to clipboard

N°5370 - Improve feedback when updating objects via REST without changes

Open larhip opened this issue 4 years ago • 7 comments

When updating an object via REST the feedback is always "updated", doesn't matter whether there is a real change.

It might be interesting to give a feedback via rest whether the object has been changed or not, just like it is in the UI.

This PR checks whether an object is modified and set message to "unchanged" if not.

larhip avatar Aug 05 '21 08:08 larhip

Hello Lars, I'll check this PR on friday, would you update/rebase you branch on develop in the meantime? Thanks

Molkobain avatar May 03 '22 12:05 Molkobain

Accepted during technical review. Guillaume will created the corresponding bug in our internal bug tracker.

Remaining question for technical / functional teams: Should we add v1.4 of the API for this, if so in which iTop versions.

Molkobain avatar Aug 02 '22 14:08 Molkobain

Hello Lars,

The functional aspect was accepted during today's review. We are still discussing about the technical implementation as it might be a breaking change for some people interpreting the result of the call in the v1.3 of the API.

I'm checking if there are other REST/API related bugs that we could pack to this future v1.4 version of the API.

Cheers, Guillaume

Molkobain avatar Aug 09 '22 15:08 Molkobain

For now iTop doesn't handle multiple versions of it own API meaning that one cannot call API v1.2 on iTop 3.0 for example. If we increase the version to 1.4 for this change in iTop 3.1, all existing webservices querying iTop with the v1.3 of the API will break after upgrading to iTop 3.1... This is quite ugly. 😕

We should think to a proper way to handle this better, do you have any proposition?

PS: Except for a better handling of tag attributes, there were not many requests on the REST/API enhancements

Molkobain avatar Aug 09 '22 16:08 Molkobain

@Molkobain there is the $sVersion variable where it can do a version_compare to do the current behaviour or the new behaviour..

Hipska avatar Aug 09 '22 16:08 Hipska

Yes, what I meant is that I don't feel like adding "if / version_compare()" conditions everywhere in the ExecOperation() method each time we change something. Even though there would be only one for now, it would eventually become a mess. That's why I would like to find a more elegant solution; do you know how other APIs manage it?

Molkobain avatar Aug 10 '22 07:08 Molkobain

This might be useful to read: https://stackoverflow.com/questions/29871744/how-do-you-manage-the-underlying-codebase-for-a-versioned-api

Hipska avatar Aug 10 '22 15:08 Hipska