[aerogear-dev] broken push notification in UPS 1.1.3.Final

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
Hi,

we noticed some strange behavior when sending notifications to all variants of an app:
- we have 3 ios devices
- 7 android devices
- when sending a notification to all variants, 4 devices are notified

This applies to the REST interface too.
When sending messages to only one variant, the number of recipients is correct for both the web and the rest interface.

It would be nice to get some hint what could be wrong...

Regards
Mischa

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev

server.log (65K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf


On Wed, Jul 20, 2016 at 2:35 PM, Neumann, Mischa (init) <[hidden email]> wrote:
Hi,

we noticed some strange behavior when sending notifications to all variants of an app:
- we have 3 ios devices
- 7 android devices
- when sending a notification to all variants, 4 devices are notified

instead of 10 - that's wrong :)

Can you share the CURL for the rest call?


In the log, I see that sometimes FCM is hit - that means all devices are notified via one FCM topic - the logging says:
Loaded batch #1, containing 1 tokens

but, all devices, on that (global) topic, should get a message

-Matthias

 

This applies to the REST interface too.
When sending messages to only one variant, the number of recipients is correct for both the web and the rest interface.

It would be nice to get some hint what could be wrong...

Regards
Mischa

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
In reply to this post by mischa
we worked around this by explicitely filtering for all known variants when sending a push message through the REST interface...
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
In reply to this post by Matthias Wessendorf
Matthias Wessendorf wrote
On Wed, Jul 20, 2016 at 2:35 PM, Neumann, Mischa (init) <
[hidden email]> wrote:

> Hi,
>
> we noticed some strange behavior when sending notifications to all
> variants of an app:
> - we have 3 ios devices
> - 7 android devices
> - when sending a notification to all variants, 4 devices are notified
>

instead of 10 - that's wrong :)

Can you share the CURL for the rest call?
no curl, but the payload (REST) is something like

{"message":{"alert":"unit-test alert message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["unit-test"]},"config":{"ttl":-1}}

and from the WEB interface

{
  "alert": "an alle ohne kategorie",
  "priority": "normal",
  "criteria": {
    "categories": null,
    "variants": null,
    "alias": null,
    "deviceType": null
  },
  "config": {
    "ttl": -1
  }
}

Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf
In reply to this post by mischa
Not sure I follow here

On Fri, Jul 22, 2016 at 9:00 AM, mischa <[hidden email]> wrote:
we worked around this by explicitely filtering for all known variants when
sending a push message through the REST interface...



--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-broken-push-notification-in-UPS-1-1-3-Final-tp12629p12632.html
Sent from the aerogear-dev mailing list archive at Nabble.com.
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf
In reply to this post by mischa
when you say 4 devices - out of 10 are receiving notifications:
are that all 3 ios devices, and just one Android device?

what version of the Android SDK are you using ? 

On Fri, Jul 22, 2016 at 9:09 AM, mischa <[hidden email]> wrote:
Matthias Wessendorf wrote
> On Wed, Jul 20, 2016 at 2:35 PM, Neumann, Mischa (init) <

> Mischa.Neumann@

>> wrote:
>
>> Hi,
>>
>> we noticed some strange behavior when sending notifications to all
>> variants of an app:
>> - we have 3 ios devices
>> - 7 android devices
>> - when sending a notification to all variants, 4 devices are notified
>>
>
> instead of 10 - that's wrong :)
>
> Can you share the CURL for the rest call?

no curl, but the payload (REST) is something like

{"message":{"alert":"unit-test alert
message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["unit-test"]},"config":{"ttl":-1}}

and from the WEB interface

{
  "alert": "an alle ohne kategorie",
  "priority": "normal",
  "criteria": {
    "categories": null,
    "variants": null,
    "alias": null,
    "deviceType": null
  },
  "config": {
    "ttl": -1
  }
}

Mischa



--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-broken-push-notification-in-UPS-1-1-3-Final-tp12629p12633.html
Sent from the aerogear-dev mailing list archive at Nabble.com.
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
In reply to this post by Matthias Wessendorf
Matthias Wessendorf wrote
Not sure I follow here

On Fri, Jul 22, 2016 at 9:00 AM, mischa <[hidden email]> wrote:

> we worked around this by explicitely filtering for all known variants when
> sending a push message through the REST interface...
when sending
    {"message":{"alert":"unit-test alert message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["unit-test"],"variants":["65bac606-5b73-42d8-9641-d70948c9717e","f2eed0fb-6e9a-42c6-8759-457e2241daae"]},"config":{"ttl":-1}}
all devices are notified, with
    {"message":{"alert":"unit-test alert message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["unit-test"]},"config":{"ttl":-1}}
not

Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf
only Android devices are not getting the message ? 

On Fri, Jul 22, 2016 at 9:13 AM, mischa <[hidden email]> wrote:
Matthias Wessendorf wrote
> Not sure I follow here
>
> On Fri, Jul 22, 2016 at 9:00 AM, mischa &lt;

> mischa.neumann@

> &gt; wrote:
>
>> we worked around this by explicitely filtering for all known variants
>> when
>> sending a push message through the REST interface...

when sending
    {"message":{"alert":"unit-test alert
message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["unit-test"],"variants":["65bac606-5b73-42d8-9641-d70948c9717e","f2eed0fb-6e9a-42c6-8759-457e2241daae"]},"config":{"ttl":-1}}
all devices are notified, with
    {"message":{"alert":"unit-test alert
message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["unit-test"]},"config":{"ttl":-1}}
not

Mischa



--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-broken-push-notification-in-UPS-1-1-3-Final-tp12629p12636.html
Sent from the aerogear-dev mailing list archive at Nabble.com.
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
In reply to this post by Matthias Wessendorf
Matthias Wessendorf wrote
when you say 4 devices - out of 10 are receiving notifications:
are that all 3 ios devices, and just one Android device?

what version of the Android SDK are you using ?
yes, you are right, now:
- we have 26 android and 5 ios devices, all registered to the category "PRODUCTS"
- {"message":{"alert":"unit-test alert message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["PRODUCTS"]},"config":{"ttl":-1}}
is delivered to 6 devices (5 ios and 1 android)

the devices are not registering themselves at the UPS but the backend server does this as a delegate.
sample from unit test:

>> "Authorization: Basic ZjJl..."
>> "{"alias":"42","categories":["FOOD","PRODUCTS"],"deviceToken":"aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa 302087"}"

<< "{"id":"6b186514-f0d7-461a-b996-b6efee732a04","enabled":true,"deviceToken":"aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa 302087","deviceType":null,"operatingSystem":null,"osVersion":null,"alias":"42","categories":[{"name":"PRODUCTS"},{"name":"FOOD"}],"platform":null}[\r][\n]"

--> works like a charm

Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
In reply to this post by Matthias Wessendorf
Matthias Wessendorf wrote
only Android devices are not getting the message ?
exactly, all ios and one android device...

Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf
In reply to this post by mischa
Ah, I think the delegate is the issue; because it lacks the FCM topic code from Android SDK



On Friday, 22 July 2016, mischa <[hidden email]> wrote:
Matthias Wessendorf wrote
> when you say 4 devices - out of 10 are receiving notifications:
> are that all 3 ios devices, and just one Android device?
>
> what version of the Android SDK are you using ?

yes, you are right, now:
- we have 26 android and 5 ios devices, all registered to the category
"PRODUCTS"
- {"message":{"alert":"unit-test alert
message","badge":-1,"priority":"NORMAL","windows":{"type":null,"duration":null,"badge":null,"tileType":null,"toastType":null,"images":[],"textFields":[],"page":null},"apns":{"content-available":false},"user-data":{"warningId":12}},"criteria":{"categories":["PRODUCTS"]},"config":{"ttl":-1}}
is delivered to 6 devices (5 ios and 1 android)

the devices are not registering themselves at the UPS but the backend server
does this as a delegate.
sample from unit test:

>> "Authorization: Basic ZjJl..."
>> "{"alias":"42","categories":["FOOD","PRODUCTS"],"deviceToken":"aaaaaaaa
>> aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa 302087"}"

<<
"{"id":"6b186514-f0d7-461a-b996-b6efee732a04","enabled":true,"deviceToken":"aaaaaaaa
aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
302087","deviceType":null,"operatingSystem":null,"osVersion":null,"alias":"42","categories":[{"name":"PRODUCTS"},{"name":"FOOD"}],"platform":null}[\r][\n]"

--> works like a charm

Mischa




--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-broken-push-notification-in-UPS-1-1-3-Final-tp12629p12638.html
Sent from the aerogear-dev mailing list archive at Nabble.com.
_______________________________________________
aerogear-dev mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;aerogear-dev@lists.jboss.org&#39;)">aerogear-dev@...
https://lists.jboss.org/mailman/listinfo/aerogear-dev


--
Sent from Gmail Mobile

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
Matthias Wessendorf wrote
Ah, I think the delegate is the issue; because it lacks the FCM topic code
from Android SDK
we had no problems with aerogear-unifiedpush-server-1.2.0-alpha.1
and not when naming the variants with aerogear-unifiedpush-server-1.1.3.Final

but I would give it a try:

how would a correct json request look like?
couldn't find something matching at https://aerogear.org/docs/specs/aerogear-unifiedpush-rest-1.0.x/registry/device/index.html 

Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf


On Fri, Jul 22, 2016 at 10:42 AM, mischa <[hidden email]> wrote:
Matthias Wessendorf wrote
> Ah, I think the delegate is the issue; because it lacks the FCM topic code
> from Android SDK

we had no problems with aerogear-unifiedpush-server-1.2.0-alpha.1
and not when naming the variants with

1.1.2 and 1.2.0-alpha.1 is not containing FCM
 
aerogear-unifiedpush-server-1.1.3.Final

but FCM is included in 1.1.3 and master (1.2.0-alpha.2-SNAPSHOT)


FCM registration is done here:
 
But... I wonder... if we can, or should, do something about that on the srver side... hrm...


but I would give it a try:

how would a correct json request look like?
couldn't find something matching at
https://aerogear.org/docs/specs/aerogear-unifiedpush-rest-1.0.x/registry/device/index.html

Mischa



--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-broken-push-notification-in-UPS-1-1-3-Final-tp12629p12641.html
Sent from the aerogear-dev mailing list archive at Nabble.com.
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
Matthias Wessendorf wrote
On Fri, Jul 22, 2016 at 10:42 AM, mischa <[hidden email]> wrote:

> Matthias Wessendorf wrote
> > Ah, I think the delegate is the issue; because it lacks the FCM topic
> code
> > from Android SDK
>
> we had no problems with aerogear-unifiedpush-server-1.2.0-alpha.1
> and not when naming the variants with
>

1.1.2 and 1.2.0-alpha.1 is not containing FCM


> aerogear-unifiedpush-server-1.1.3.Final
>

but FCM is included in 1.1.3 and master (1.2.0-alpha.2-SNAPSHOT)


FCM registration is done here:
https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java#L186-L191

But... I wonder... if we can, or should, do something about that on the
srver side... hrm...
I see:
    ... Sent push notification to GCM topic: /topics/PRODUCTS ...
and as no client didn't register with the help of aerogear-android-push for this topic at Firebase, it wouldn't get any notifications.

then the frontend message "X receivers" is misleadingly as one receiver is a FCM topic channel :-)

and it's not clear, why the UPS is behaving differently when the android variant is directly targeted in the push request.

Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
In reply to this post by Matthias Wessendorf
Matthias Wessendorf wrote
On Fri, Jul 22, 2016 at 10:42 AM, mischa <[hidden email]> wrote:

But... I wonder... if we can, or should, do something about that on the
srver side... hrm...
I think you can't and you shouldn't.

We will keep an eye on that issue and count in that our actual workaround might not work in future versions of UPS.
in long-term we will add a firebase topic (un)subscription to the android part that is registering at our backend (we are prepared that a notify-all-message send by the UPS web interface will not reach any android client)

Thanks a lot for your great support
Mischa
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

Matthias Wessendorf
In reply to this post by mischa


On Fri, Jul 22, 2016 at 11:19 AM, mischa <[hidden email]> wrote:
Matthias Wessendorf wrote
> On Fri, Jul 22, 2016 at 10:42 AM, mischa &lt;

> mischa.neumann@

> &gt; wrote:
>
>> Matthias Wessendorf wrote
>> > Ah, I think the delegate is the issue; because it lacks the FCM topic
>> code
>> > from Android SDK
>>
>> we had no problems with aerogear-unifiedpush-server-1.2.0-alpha.1
>> and not when naming the variants with
>>
>
> 1.1.2 and 1.2.0-alpha.1 is not containing FCM
>
>
>> aerogear-unifiedpush-server-1.1.3.Final
>>
>
> but FCM is included in 1.1.3 and master (1.2.0-alpha.2-SNAPSHOT)
>
>
> FCM registration is done here:
> https://github.com/aerogear/aerogear-android-push/blob/master/aerogear-android-push/src/main/java/org/jboss/aerogear/android/unifiedpush/fcm/AeroGearFCMPushRegistrar.java#L186-L191
>
> But... I wonder... if we can, or should, do something about that on the
> srver side... hrm...

I see:
    ... Sent push notification to GCM topic: &#x2F;topics&#x2F;PRODUCTS ...
and as no client didn't register with the help of aerogear-android-push for
this topic at Firebase, it wouldn't get any notifications.

then the frontend message "X receivers" is misleadingly as one receiver is a
FCM topic channel :-)

yeah, that's something we need to fix - I am not happy w/ that too 
 

and it's not clear, why the UPS is behaving differently when the android
variant is directly targeted in the push request.

because, than we don't do the topic :) we do direct device tokens:

So... we have some hooks to not go w/ FCM topics..... but I hate to introduce a flag to not use FCM topics.....   
So, perhaps for you guys, just send a few request w/ variants tagged? instead of one - that would work - and will continue to work :D



Mischa



--
View this message in context: http://aerogear-dev.1069024.n5.nabble.com/aerogear-dev-broken-push-notification-in-UPS-1-1-3-Final-tp12629p12643.html
Sent from the aerogear-dev mailing list archive at Nabble.com.
_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev



--

_______________________________________________
aerogear-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/aerogear-dev
Reply | Threaded
Open this post in threaded view
|

Re: [aerogear-dev] broken push notification in UPS 1.1.3.Final

mischa
Matthias Wessendorf wrote
So... we have some hooks to not go w/ FCM topics..... but I hate to
introduce a flag to not use FCM topics.....
So, perhaps for you guys, just send a few request w/ variants tagged?
instead of one - that would work - and will continue to work :D
It's no problem for us to always set the targeted variants when pushing from our backend.
and when sending from the web frontend we have to select each variant instead of none - just checked: works too.

have a nice weekend
Mischa