Closed Bug 1039617 Opened 10 years ago Closed 6 years ago

Oldest Cell Broadcast messages displayed first

Categories

(Firefox OS Graveyard :: Gaia::System, defect, P1)

ARM
Gonk (Firefox OS)
defect

Tracking

(feature-b2g:3.0?, tracking-b2g:backlog)

RESOLVED WONTFIX
feature-b2g 3.0?
tracking-b2g backlog

People

(Reporter: mschwart, Unassigned)

Details

(Whiteboard: [caf priority: p2][CR 811151])

Attachments

(1 file)

Steps to reproduce:

1. Receive more than one Cell Broadcast or Broadcast SMS message

Expected result: Newest message shown on top
Observed result: Oldest message shown on top
As per CMAS TC 26.1 the new message should be displayed on the top of the previous one.

STR:
1. Opt in to receive all Categories from the Receive Alert menu. All Categories are opted in. 
2. Set the Master Volume setting to Medium. Set the Alert Vibrate setting to On
3. Send CMAS message to the device with category Presidential Alert --> Verify CMAS message is received and displayed on the device screen. 
4. Send another CMAS message to the device with category Extreme Alert before the first message is acknowledged. --> Verify CMAS is displayed on  top of the first CMAS message.
5. Send the third CMAS message to the device with category Severe Alert before the previous message is acknowledged --> Verify  CMAS  is displayed on top of the previous CMAS message. 
6. Send the fourth CMAS message to the device with the category AMBER before the previous message is acknowledged --> CMAS  is displayed on top of the previous CMAS message
7. Press OK or CLR key to dismiss the last CMAS message (AMBER alert). Device displays the CMAS message sent in step 5 (Severe alert).
8. Press OK or CLR key to dismiss the CMAS message with Severe Alert. Device displays the CMAS message sent in step 4 (Extreme Alert)
9. Press OK or CLR key to dismiss the CMAS message with Extreme Alert. Device displays the CMAS message sent in step 3 (Presidential Alert)
10. Press OK or CLR key to dismiss the CMAS message with Extreme Alert. Device displays Main/Idle screen.

From steps 4 and  onward, Latest CMAS is not displayed on the top of previous alert. this is failing the verification  of this TC.
Depends on: CAF-v2.2-metabug
No longer depends on: CAF-v2.2-metabug
Whiteboard: [CR 811151]
Whiteboard: [CR 811151] → [caf priority: p2][CR 811151]
blocking-b2g: --- → 2.2?
Hi Francisco,
Can you have someone on your team look into this issue? It's causing a certification tests case to fail.

Julien,
I'm needinfo'ing you since you're he Messages component owner and Francisco's bugmail id isn't @mozilla.com.

Thanks,
Mike
Component: Gaia::System → Gaia::SMS
Flags: needinfo?(francisco)
Flags: needinfo?(felash)
I think Julien, already cced, owner of sms, will be have the information needed.
Flags: needinfo?(francisco)
This is actually part of Network Alerts.

However I don't know how to fix this to be honest. We use the System's notification feature and that's how the notification panel works.

Michael, any idea how we could accomodate this ?
Component: Gaia::SMS → Gaia::Network Alerts
Flags: needinfo?(felash) → needinfo?(mhenretty)
The notification API was not designed to accommodate this use case. Regardless of how we do this, we need a way for the CMAS app to tell the system which notifications should display first, because changing the default ordering for new notifications seems like a non-starter. Here's what I think the easiest approach is:

CMAS is aware of any pending notifications in the utility tray (either by keeping a copy in memory, or Notification.get) with their associated tags. Whenever we get a new network alert and there is one existing, we replace the existing notification with the new network alert data using the tag, then we fire a new notification for the old network alert. Since CMAS notifications don't trigger the toaster, I don't think we have a UI problem with this approach. Obviously, if there are multiple existing CMAS notifications, you will have to replace each one with the data from the one before it, and only fire a new notification for the oldest one.

Also, now would be a great time to remove the workarounds in place for CMAS notifications in notifications.js [1], and instead use the noNotify/silent flags in the API.

1.) https://github.com/mozilla-b2g/gaia/blob/7cb0a41dca67d8f8cbb6ce21a34ce875998f90b5/apps/system/js/notifications.js#L46
Flags: needinfo?(mhenretty)
(In reply to Michael Henretty [:mhenretty] from comment #5)
> The notification API was not designed to accommodate this use case.
> Regardless of how we do this, we need a way for the CMAS app to tell the
> system which notifications should display first, because changing the
> default ordering for new notifications seems like a non-starter. Here's what
> I think the easiest approach is:
> 
> CMAS is aware of any pending notifications in the utility tray (either by
> keeping a copy in memory, or Notification.get) with their associated tags.
> Whenever we get a new network alert and there is one existing, we replace
> the existing notification with the new network alert data using the tag,
> then we fire a new notification for the old network alert. Since CMAS
> notifications don't trigger the toaster, I don't think we have a UI problem
> with this approach. Obviously, if there are multiple existing CMAS
> notifications, you will have to replace each one with the data from the one
> before it, and only fire a new notification for the oldest one.

Ok, we can try this. This feels really like a hack though :/

> 
> Also, now would be a great time to remove the workarounds in place for CMAS
> notifications in notifications.js [1], and instead use the noNotify/silent
> flags in the API.

Maybe only in master then :)

> 
> 1.)
> https://github.com/mozilla-b2g/gaia/blob/
> 7cb0a41dca67d8f8cbb6ce21a34ce875998f90b5/apps/system/js/notifications.js#L46
Is it a certification test blocker?
Per comment 5 this looks like a new feature and I suppose FxOS behavior is the same from 2.0, 2.1, 2.2 and master.
Wesley, it is a certification blocker and has always been. In the past our customers might have given an exceptions but we need to find time to fix it. I am opposed to finding a dirty fix for this issue if we can not find time in 2.2 to properly fix it given that this behavior is the same from 2.0.

Is there a way to track all the bugs that fail certification that should be addressed with higher priority than rest of the backlogs bugs in the future releases?
Sandip & Ravi,

Please respond to comment 7 and comment 8 re: handling this new feature request that's also certification blocker.

Thanks,
Mike
Flags: needinfo?(skamat)
Flags: needinfo?(rdandu)
Anshul, Is this the CMAS (Commercial Mobile Alert Service) test case. Do you know which operator runs this certification? That information will help us plan and schedule this. 

We need to figure out why this wasn't flagged in 2.2 planning.
Flags: needinfo?(skamat)
Flags: needinfo?(rdandu)
Flags: needinfo?(anshulj)
(In reply to rdandu from comment #10)
> We need to figure out why this wasn't flagged in 2.2 planning.

It's because this is not a new feature.  All flavours of cell broadcast have the latest on top.  You want to know about the most recent tornado heading your way first, right?  This is a bug in the Gaia implementation that I raised back in July but didn't flag it properly so it missed triage.
To add to what M4 said, this is part of standard conformance testing that our conformance team runs. In the past they may not have cycles to run the entire test suite and may have missed this test case for previous releases.
Flags: needinfo?(anshulj)
[Blocking Requested - why for this release]:

triage: this is new feature, and landing such patch one week before FC is too risky. 
Let's not block on it.
blocking-b2g: 2.2? → ---
feature-b2g: --- → 3.0?
tracking-b2g: --- → +
I'll try to draft out hack from comment 5 and see how it feels
Flags: needinfo?(azasypkin)
Hey Julien,

As we agreed today, could you please help me to understand STR for this bug? I've just tried to reproduce it on the latest master and v2.2 and I see that the most recent CMAS notification is always displayed on the top in notification tray.

+ if we receive several CMAS messages in a row without acknowledging (tap OK button in CMAS message attention screen), they're stacked in the same way - latest received is always on the top.

Thanks!
Flags: needinfo?(azasypkin) → needinfo?(felash)
I agree, this seems to work for me.

Michael, maybe a video would help?
Flags: needinfo?(felash) → needinfo?(mschwart)
I got an idea Oleg (haven't checked yet), maybe the STR is:

1. receive a CMAS alert -- don't click on OK !
2. receive another CMAS alert
3. click on OK twice (for each alerts)

What I tried in comment 16 was clicking OK between alerts.

Can you double check with this STR?
Flags: needinfo?(azasypkin)
See also STR in comment 1.
(In reply to Julien Wajsberg [:julienw] from comment #17)
> I got an idea Oleg (haven't checked yet), maybe the STR is:
> 
> 1. receive a CMAS alert -- don't click on OK !
> 2. receive another CMAS alert
> 3. click on OK twice (for each alerts)
> 
> What I tried in comment 16 was clicking OK between alerts.
> 
> Can you double check with this STR?

Sure with these STR, we have the following (I sent #1, #2, #3, #4 consequently):

* On display - 4 attention screens stacked in the correct order, #4 on the top;

* Notification tray: 

** attention screen link ("Tap to show") #1;
** attention screen link ("Tap to show") #2;
** attention screen link ("Tap to show") #3;
** attention screen link ("Tap to show") #4;

** Notification #4;
** Notification #3;
** Notification #2;
** Notification #1;

Michael, did you mean that attention screen links are in the wrong order?
Flags: needinfo?(azasypkin)
(In reply to Oleg Zasypkin [:azasypkin] from comment #19)
> (In reply to Julien Wajsberg [:julienw] from comment #17)
> > I got an idea Oleg (haven't checked yet), maybe the STR is:
> > 
> > 1. receive a CMAS alert -- don't click on OK !
> > 2. receive another CMAS alert
> > 3. click on OK twice (for each alerts)
> > 
> > What I tried in comment 16 was clicking OK between alerts.
> > 
> > Can you double check with this STR?
> 
> Sure with these STR, we have the following (I sent #1, #2, #3, #4
> consequently):
> 
> * On display - 4 attention screens stacked in the correct order, #4 on the
> top;
> 
> * Notification tray: 
> 
> ** attention screen link ("Tap to show") #1;
> ** attention screen link ("Tap to show") #2;
> ** attention screen link ("Tap to show") #3;
> ** attention screen link ("Tap to show") #4;
> 
> ** Notification #4;
> ** Notification #3;
> ** Notification #2;
> ** Notification #1;
> 
> Michael, did you mean that attention screen links are in the wrong order?

You mean "lock screen", right ?
NI Anshul as well because of comment 1 (Michael actually filed the bug some time ago)
Flags: needinfo?(anshulj)
Flags: needinfo?(anshulj)
Just a thought: if the problem is wrong order of attention window links in notification tray, then we can probably always have only one attention screen (therefore only one attention screen link in notification tray) that has "smart" stack of messages to show and communicates with main app window via postMessage for example.

At the same time I don't see much value in several attention screen links for single app in notification tray. They have only application name ("Network Alerts") and "Tap to show" link comparing to notifications that have timestamp, message excerpt and correctly ordered.
(In reply to Wesley Huang [:wesley_huang] (EPM) (NI me) from comment #13)
> [Blocking Requested - why for this release]:
> 
> triage: this is new feature, and landing such patch one week before FC is
> too risky. 
> Let's not block on it.

Mike, can you talk with the partner to see if it's okay to postpone to the next version?
Flags: needinfo?(mlee)
Flags: needinfo?(mschwart)
Flags: needinfo?(cyang)
Spoke with CAF (Inder & Anshul) today. Carol (CAF) will followup.
Flags: needinfo?(mlee)
Hi all,

First, just wanted to mention that due to checks at [1] and [2], only GSM CMAS messages are handled by the Network Alert app. All other cell broadcast messages are handled by cell_broadcast_system.js. 

Now, it looks like Network Alert app will display the messages in the right order (newest one on top). The problem is with the rest of cell broadcast messages not handled by Network Alert app. Please see the attached video where I injected two regular cell broadcast messages, in the order of "dgghr" first, followed by "A GSM default alphabet message...". Note that "dgghr" remained on top the whole time and you can only see the newer message after you've dismissed the first message.

Seems like the long term plan is to move all cbs support to Network Alert app. What are the plans for the near future to address the current problem though?

[1] https://github.com/mozilla-b2g/gaia/blob/v2.2/apps/network-alerts/js/index.js#L45
[2] https://github.com/mozilla-b2g/gaia/blob/v2.2/apps/system/js/cell_broadcast_system.js#L79
Flags: needinfo?(cyang)
Oh I see, then it's a System issue.

In carrier_info_notifier.js we use the normal "addNotification" method, I guess we could try to use the same arguments as we use from the Network Alerts app (but I understand the Network Alerts messages are more important and should always stay on top of other CB messages).
Component: Gaia::Network Alerts → Gaia::System
(In reply to Julien Wajsberg [:julienw] from comment #26)
> Oh I see, then it's a System issue.
> 
> In carrier_info_notifier.js we use the normal "addNotification" method, I
> guess we could try to use the same arguments as we use from the Network
> Alerts app (but I understand the Network Alerts messages are more important
> and should always stay on top of other CB messages).

On that note, I did try a case where I would inject GSM CMAS followed by a regular CBS message. In that case, the CBS (system) message did show up on top. And then injecting another GSM CMAS message would then result in the CMAS message showing up above the CBS message.
OK, I think this is wrong as well...
It seems like the proper fix would be to move the handling of CBS messages to network alerts. I am removing it as a blocking 2.2 bucket so we have time to fix it properly in the next release.
No longer blocks: CAF-v2.2-metabug
No longer blocks: CAF-v2.2-metabug
Firefox OS is not being worked on
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: