Merge lp:~mzanetti/reminders-app/no-network into lp:reminders-app
Status: | Merged |
---|---|
Approved by: | Riccardo Padovani |
Approved revision: | 112 |
Merged at revision: | 110 |
Proposed branch: | lp:~mzanetti/reminders-app/no-network |
Merge into: | lp:reminders-app |
Diff against target: |
240 lines (+102/-80) 4 files modified
src/plugin/Evernote/evernoteconnection.cpp (+86/-75) src/plugin/Evernote/evernoteconnection.h (+4/-3) src/plugin/Evernote/jobs/notesstorejob.cpp (+6/-1) src/plugin/Evernote/jobs/userstorejob.cpp (+6/-1) |
To merge this branch: | bzr merge lp:~mzanetti/reminders-app/no-network |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Riccardo Padovani | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+217820@code.launchpad.net |
Commit message
Make the app more robust against network outtakes.
Description of the change
This makes the app not crash when there's no network connection at startup.
Basically it moves the part that could fail from setupUserStore() and setupNotesStore() into a separate method connectToEvernote() which just does the open() on the network sockets (also checks the server's version number and prints a note for us that we should update it).
The jobs were already smart enough to reopen the connection on demand. I just added a small check for them to be opened before closing them to avoid the exception bailing out before reaching the open() call.
Now the app should recover automatically if the network fails for a while and comes back after.
Still TODO:
* Expose connection errors to the ui and show them to the user somehow.
* Use QNetworkConfigu
PASSED: Continuous integration, rev:111 91.189. 93.70:8080/ job/reminders- app-ci/ 277/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 2327 91.189. 93.70:8080/ job/reminders- app-saucy- amd64-ci/ 277 91.189. 93.70:8080/ job/reminders- app-trusty- amd64-ci/ 277
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/reminders- app-ci/ 277/rebuild
http://