sdl_java_suite icon indicating copy to clipboard operation
sdl_java_suite copied to clipboard

Alert RPCs through Alert Manager stop working if the first was not dismissed.

Open mjuarez-ford opened this issue 3 years ago • 11 comments

Bug Report

Alerts stop working if the previous notification was not dismissed by the User.

Reproduction Steps
  1. Connect the phone to the TDK
  2. The app must have Alert and background permissions (SYNC)
  3. The app does not need to be open on the HMI, the state of the app is HMI_BACKGROUND
  4. Send an alert with buttons, and do not dismiss it.
  5. Send another Alert (2nd). (this alert is not displayed)
  6. Dismiss the first Alert
  7. Send the 3rd Alert.
  8. The 3rd and consecutive Alert are not sent to the HMI.
Expected Behavior

The user should keep receiving notifications.

Observed Behavior

On the SYNC logs, I verify that on the HMI the Alert RPC is not received. And on the PresentAlertOperation the start() is not executed.

When everything is executing correctly on the Queue class the properties head and tail are always null. But after it breaks it always adds them to the queue.

public void add(Task task, boolean placeAtHead) {
....
  else {
      Queue.Node<Task> taskNode = new Queue.Node(task, this.head, this.tail);
      this.head = taskNode;
      this.tail = taskNode;
  }
...

If we follow the steps on the Reproduction Steps on the step **5** it could be that the TaskMaster in charge of the alert queue is no longer running or is waiting for a response.

OS & Version Information
  • Android Version: 9
  • SDL Android Version: 5.3.0
  • Testing Against: SDL Hello World with the same code
Test Case, Sample Code, and / or Example App
int i = 0;
Timer timer = new Timer();
timer.schedule(new TimerTask() {
    @Override
    public void run() {
        sendAlert();
    }
},0,50000);


public void sendAlert() {
  AlertView.Builder builder = new AlertView.Builder();
  builder.setText("text 1");
  builder.setSecondaryText("text 2");
  builder.setSoftButtons(getButtons());
  AlertView alert = builder.build();
  sdlManager.getScreenManager().presentAlert(alert, (success, tryAgainTime) -> {
      DebugTool.logInfo(TAG,"Success: "+ success);
  });
}

private ArrayList<SoftButtonObject> getButtons() {
    SoftButtonState okButtonState = new SoftButtonState("okButtonAlertState","okButtonAlertState",null);
    SoftButtonObject okSoftButtonObj = new SoftButtonObject("okButtonAlert", okButtonState, new 
    SoftButtonObject.OnEventListener() {
        @Override
        public void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress) {
            DebugTool.logInfo(TAG, "OK BUTTON PRESSED");
        }

        @Override
        public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent) {
            DebugTool.logInfo(TAG, "OK BUTTON "+ onButtonEvent.toString());
        }
    });
    SoftButtonState cancelButtonState = new SoftButtonState("cancelButtonAlertState","cancelButtonState",null);
    SoftButtonObject cancelButtonObj = new SoftButtonObject("cancelButtonAlertState", cancelButtonState, new SoftButtonObject.OnEventListener() {
        @Override
        public void onPress(SoftButtonObject softButtonObject, OnButtonPress onButtonPress) {
            DebugTool.logInfo(TAG, "CANCEL BUTTON PRESSED");
        }

        @Override
        public void onEvent(SoftButtonObject softButtonObject, OnButtonEvent onButtonEvent) {
            DebugTool.logInfo(TAG, "CANCEL BUTTON "+onButtonEvent.toString());
        }
    });
    return new ArrayList<SoftButtonObject>(Arrays.asList(okSoftButtonObj,cancelButtonObj));
}

mjuarez-ford avatar Dec 23 '21 08:12 mjuarez-ford

Hi @mjuarez-ford, we tried to reproduce the issue on Manticore but we were not able to see the issue. We couldn't test the exact scenario on Sync because we don't have an app that has the permissions to send Alerts in the Background on Sync. would be able to see if the issue happens when you test on Manticore? also does the issue happen every time when you go through the same scenario or only rarely?

bilal-alsharifi avatar Jan 07 '22 15:01 bilal-alsharifi

Hi @bilal-alsharifi, I'll try it with Manticore, Yes happens all the time. I will create an app ID with all necessary permissions for the test, who I can share it with you?

mjuarez-ford avatar Jan 11 '22 10:01 mjuarez-ford

@mjuarez-ford Sounds great. Can you send me info on Slack?

bilal-alsharifi avatar Jan 11 '22 14:01 bilal-alsharifi

sure @bilal-alsharifi, I just shared the info there.

mjuarez-ford avatar Jan 12 '22 08:01 mjuarez-ford

Hi, @bilal-alsharifi were you able to reproduce it? I was not able to reproduce it in Manticore, but it always happens on Sync3. I can share the SmartDeviceLink Logs from the TDK on Slack if that helps in any way.

mjuarez-ford avatar Jan 18 '22 12:01 mjuarez-ford

Hello @mjuarez-ford, Bilal is no longer working on this project. We have internally reassigned this task and will get back to you when we can. In the meantime, if you can provide (privately) a Sync app id and app name that have these permissions, that would be a great help in tracking this issue down. You can also provide the TDK logs, but they will be more difficult for our engineers to parse and less likely to be useful.

Thank you!

joeljfischer avatar Jan 18 '22 14:01 joeljfischer

Hello @joeljfischer, is there any update on this issue?

mjuarez-ford avatar Feb 15 '22 09:02 mjuarez-ford

Hi @mjuarez-ford, this task has not yet been started, but it should be soon. We have been working through crashing bugs first, but the plan is still for this issue to be investigated and solved before the April release.

joeljfischer avatar Feb 15 '22 14:02 joeljfischer

Thanks so much for the feedback @joeljfischer.

mjuarez-ford avatar Feb 15 '22 15:02 mjuarez-ford

Hi @joeljfischer is there any news regarding this issue?

mjuarez-ford avatar Mar 14 '22 08:03 mjuarez-ford

Due to unforeseen circumstances, this bug will not be fixed in the upcoming release. I responded with more detail on Slack.

joeljfischer avatar Mar 14 '22 12:03 joeljfischer