Watson
Watson copied to clipboard
Sync Feature
Hi would it be possible to sync frames between two desktops? I work on two computers as of the moment and I would like to sync time tracking between them (OS and Windows). Thanks!
You can use a cloud service like Dropbox or alike to automate frames synchronization. I used to do so using Mackup between MacOS & Linux. There is probably an alternative that also supports Windows.
Very clueless on this, may you link me to some resources to help me understand this setup?
On Mon, Oct 19, 2020 at 4:50 PM Julien Maupetit [email protected] wrote:
You can use a cloud service like Dropbox or alike to automate frames synchronization. I used to do so using Mackup https://github.com/lra/mackup between MacOS & Linux. There is probably an alternative that also supports Windows.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/TailorDev/Watson/issues/399#issuecomment-711869122, or unsubscribe https://github.com/notifications/unsubscribe-auth/APPBLOBLRI4EN3KUVGOC2ODSLP4WFANCNFSM4SU64PQQ .
-- Jedidiah Carl O. Tan UPD BS CS
Have you read Mackup project's README? I think it's a good starting point.
Since crick is not active developed anymore and I dont't know the Go language, I implemented a github workflow to have my frames sync between my devices. And I created some CLI aliases to have an easy high level git workflow for watson. ( e.g. wpush
to push to github and wpull
to pull)
@jmaupetit Would it be interesting for your doc section if I write a tutorial how I implemented it?
@jmaupetit Would it be interesting for your doc section if I write a tutorial how I implemented it?
Yeah, sure! Feel free to propose a narrative in the docs. Thanks.
Yeah, sure! Feel free to propose a narrative in the docs. Thanks.
Cool. Will do that.
@mpagels Hi, is there any update on that sync tutorial? Would like to follow it and implement such a workflow.
@mpagels Hi, is there any update on that sync tutorial? Would like to follow it and implement such a workflow.
OMG I almost forgot about it. I'm sorry. Will do a look next week in my workflow and try to find time to create a little tutorial. Would you be interested to make an "early" review of it at the end of the week?
@mpagels Hi, is there any update on that sync tutorial? Would like to follow it and implement such a workflow.
OMG I almost forgot about it. I'm sorry. Will do a look next week in my workflow and try to find time to create a little tutorial. Would you be interested to make an "early" review of it at the end of the week?
That would be nice, sure!
@mpagels Hi, is there any update on that sync tutorial? Would like to follow it and implement such a workflow.
OMG I almost forgot about it. I'm sorry. Will do a look next week in my workflow and try to find time to create a little tutorial. Would you be interested to make an "early" review of it at the end of the week?
@mpagels Hi there! A couple of friends who want to use watson and sync their frames, reminded me about this, are there any tips to keep in mind for reproducing your github workflow? ( as cloud syncing has some issues)
A quick answer here with some bullets could be ok of course.
@stefanosh i did today a dump of the http communication currently done by watson sync
command, the basic "server-part" for that was a simple index.php that responds to some of the GET+POST request described in the crick api docs.
- First i realized, that watson is not using the /watson uri prefix anymore (as it was in the crick api docs)
- Second,if there are no frames to send by the server,a simple empty array has to be
json_encode
-ed - Third, the sync does not resend, if there is a
last_sync
file next toconfig
and no frames were added since the last sync timestamp recorded in that file.
The mocked server just logs the GET /frames/
and responds with that empty array, after that it logs the POST to /frames/bulk/
, and the request-body in json_decode
-d format.
After reading the resulting logs, i think to create a simple sync-api server its just an extra field to store for the frames: synced_at
to only respond with newer frames than that timestamp in case of GET, use the token in the authorization header to determine which user it is.
To store the frames for a specific user, use the token in the authorization header to determine which user it is, and store the POST body frame by frame
the very most simple mysql db structure for this would be:
CREATE TABLE frames (
uuid binary(16) NOT NULL, -- the posted string can be "converted" to store a bit efficient way: unhex(replace(replace("<input_frame_id>","urn:uuid:",""),"-",""))
id varchar(46) NOT NULL, -- the id of the frame gets posted in the following form: 'urn:uuid:UUID-DASHED-FORMAT'
start_at datetime NOT NULL,
end_at datetime NOT NULL,
project varchar(255) NOT NULL,
tags text, -- the post contains an array of the tags, either store it as serialize() or json_encode()
synchronized_at datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
user_id int(15) NOT NULL
);
CREATE TABLE users (
id int(15) NOT NULL AUTO_INCREMENT,
token varchar(255) NOT NULL -- the token set using: watson config backend.token
);
I'm still using Dropbox for the sync: is there a better way; without the danger that it will stop working?
@acidjunk
I'm still using Dropbox for the sync: is there a better way; without the danger that it will stop working?
it's a different approach,than using a cloud-based file storage, by implementing the server part of the sync
command.
@gnanet Interesting approach, thanks for the details, will consider it!
@acidjunk syncing with onedrive (the same way with dropbox) has some issues, e.g. when syncing the frames between different workstations, the frames file might get renamed or somehow merged and some frames have happened to get lost.
Has this happened with dropbox too?
I went on with investigating the possibilities, because i remembered seeing in some other issue too:
The watson sync itself is not capable to sync the removal of frames.
- The current code does not records id-s of deleted frames, with their timestamp of deletion for a later sync
- It does not pull or would not process such information, if the pulled data contained information about removed frames.
To accomplish the above features a bigger change of the core Watson code is needed.
A possible workaround could be: to use a specific tag for deletion, and use this tag as "ignore-by-default" in logs and reports, but this would not remove the frame for real, and if the removal is an intended step, for example to reduce the amount of frames, then the workaround itself is insufficient.
A workaround I use is to install watson on a remote server. Ideally I'd rather use it on individual devices and sync them together. Are there any updates on this issue?