Watson icon indicating copy to clipboard operation
Watson copied to clipboard

Watson id not catching conflicting frames

Open cgmcintyr opened this issue 6 years ago • 2 comments

I created a script to convert a csv file from an Android time tracking application into Watson frames. When doing this Watson does not recognise matching frames with the same project, start, and stop values.

This is due to the code on line 403 of watson.py which is part of the merge_report function (which also returns conflicting frames for watson to merge).

https://github.com/TailorDev/Watson/blob/46d28a70af3ff6d578533bf9441bc8ac7ac4b16b/watson/watson.py#L401-L408

Here a conflicting frame is looked up by its id. As uuid generates id's that do not reflect the content of the frame, everytime I go to import a new version of my csv, old tasks are not picked up as existing frames.

To fix this problem a sha256 hash value of the frame content could be used as a default id instead of uuid. See https://github.com/cgmcintyr/Watson/commit/9426b897b1c06444b813e672889bb5f23c4d2c11 for possible fix.

cgmcintyr avatar Jan 19 '18 18:01 cgmcintyr

Another solution would be for your script to always generate the same ID for a given frame. This is possible using a UUID v3 or v5: https://en.wikipedia.org/wiki/Universally_unique_identifier#Versions_3_and_5_(namespace_name-based)

k4nar avatar Jan 22 '18 13:01 k4nar

sha256 will be changed on any update. I have a similar problem with integration with Toggl.

https://github.com/TailorDev/Watson/issues/29

There is described a case where Toggl has his own ID and Watson has his own ID. Now there are days of microservices so data synchronization is really important. Can it be commented by a more experienced developer? Which strategy is preferred when we synchronizing different resources?

My proposition. Extend the data model by metadata with elastic structure when synchronizing plugin can save identifiers from external resources.

Related

  • https://github.com/TailorDev/Watson/issues/165

gustawdaniel avatar Jan 26 '19 23:01 gustawdaniel