Implement state-based sync (#144)

* Migrate uuids of books that already exist in server

* Remove actions

* Add dirty flag for notes and books

* Drop actions table

* Implement sync

* Add debug

* Update uuid after posting resources to the server

* Fix dev script
This commit is contained in:
Sung Won Cho 2018-12-02 11:04:16 +10:00 committed by GitHub
commit fa1da50fc5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
52 changed files with 6558 additions and 1389 deletions

View file

@ -2,6 +2,9 @@
# dev.sh builds a new binary and replaces the old one in the PATH with it
rm "$(which dnote)" $GOPATH/bin/cli
go install -ldflags "-X main.apiEndpoint=http://127.0.0.1:5000" --tags "darwin" .
ln -s $GOPATH/bin/cli /usr/local/bin/dnote
sudo rm "$(which dnote)" $GOPATH/bin/cli
# change tags to darwin if on macos
go install -ldflags "-X main.apiEndpoint=http://127.0.0.1:5000" --tags "linux" .
sudo ln -s $GOPATH/bin/cli /usr/local/bin/dnote

View file

@ -3,5 +3,9 @@
# run_server_test.sh runs server test files sequentially
# https://stackoverflow.com/questions/23715302/go-how-to-run-tests-for-multiple-packages
# clear tmp dir in case not properly torn down
rm -rf ./tmp
# run test
go test ./... -p 1