Diff comments:

> === modified file 'CMakeLists.txt'
> --- CMakeLists.txt    2015-06-14 23:34:29 +0000
> +++ CMakeLists.txt    2015-07-05 19:26:31 +0000
> @@ -20,7 +20,7 @@
>  set(AUTOPILOT_DIR reminders)
>  set(APP_HARDCODE reminders)
>  set(MAIN_QML ${APP_HARDCODE}.qml)
> -set(EXEC "reminders %u")
> +set(EXEC "reminders %u -d JobQueue")

I think this is really useful for debugging issues that happen when syncing to 
evernote. Should give us better logs from users.

>  set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Relative path to 
> the manifest file")
>  
>  set(ACCOUNT_ICON_DIR ${CMAKE_INSTALL_DATADIR}/icons/hicolor/32x32/apps)
> 
> === modified file 'src/app/qml/reminders.qml'
> --- src/app/qml/reminders.qml 2015-06-22 10:53:02 +0000
> +++ src/app/qml/reminders.qml 2015-07-05 19:26:31 +0000
> @@ -371,32 +371,35 @@
>          appId: root.applicationName + "_reminders"
>  
>          onNotificationsChanged: {
> -            print("PushClient notification:", notifications)
> -            var notification = JSON.parse(notifications)["payload"];
> -
> -            if (notification["userId"] != UserStore.userId) { // Yes, we 
> want type coercion here.
> -                console.warn("user mismatch:", notification["userId"], "!=", 
> UserStore.userId)
> -                return;
> -            }
> -
> -            switch(notification["reason"]) {
> -            case "update":
> -                print("Note updated on server:", notification["guid"])
> -                if (NotesStore.note(notification["guid"]) === null) {
> +            print("Received PushClient notifications:", notifications.length)
> +            for (var i = 0; i < notifications.length; i++) {
> +                print("notification", i, ":", notifications[i])
> +                var notification = JSON.parse(notifications[i])["payload"];
> +
> +                if (notification["userId"] != UserStore.userId) { // Yes, we 
> want type coercion here.

Push Notifications ans multiple accounts is not really tested yet. In any case, 
this place is ok, as we only want to react to push notifications for the 
currently logged user. The push-helper binary could/should be improved for 
multiuser instead.

> +                    console.warn("user mismatch:", notification["userId"], 
> "!=", UserStore.userId)
> +                    return;
> +                }
> +
> +                switch(notification["reason"]) {
> +                case "update":
> +                    print("Note updated on server:", notification["guid"])
> +                    if (NotesStore.note(notification["guid"]) === null) {
> +                        NotesStore.refreshNotes();
> +                    } else {
> +                        NotesStore.refreshNoteContent(notification["guid"]);
> +                    }
> +                    break;
> +                case "create":
> +                    print("New note appeared on server:", 
> notification["guid"])
>                      NotesStore.refreshNotes();
> -                } else {
> -                    NotesStore.refreshNoteContent(notification["guid"]);
> +                    break;
> +                case "notebook_update":
> +                    NotesStore.refreshNotebooks();
> +                    break;
> +                default:
> +                    console.warn("Unhandled push notification:", 
> notification["reason"])
>                  }
> -                break;
> -            case "create":
> -                print("New note appeared on server:", notification["guid"])
> -                NotesStore.refreshNotes();
> -                break;
> -            case "notebook_update":
> -                NotesStore.refreshNotebooks();
> -                break;
> -            default:
> -                console.warn("Unhandled push notification:", 
> notification["reason"])
>              }
>          }
>  


-- 
https://code.launchpad.net/~mzanetti/reminders-app/fix-writeback-issue/+merge/263848
Your team Ubuntu Notes app developers is subscribed to branch lp:reminders-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to     : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp

Reply via email to