Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
mjuarez-ford opened this issue Dec 23, 2021 · 11 comments

Comments

@mjuarez-ford
Copy link
Contributor

mjuarez-ford commented Dec 23, 2021

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));
}
@joeljfischer joeljfischer changed the title Notifications stop working if the first was not dimissed. Alert RPCs through Alert Manager stop working if the first was not dismissed. Jan 6, 2022
@bilal-alsharifi
Copy link
Contributor

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?

@mjuarez-ford
Copy link
Contributor Author

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?

@bilal-alsharifi
Copy link
Contributor

bilal-alsharifi commented Jan 11, 2022

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

@mjuarez-ford
Copy link
Contributor Author

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

@mjuarez-ford
Copy link
Contributor Author

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.

@joeljfischer
Copy link
Contributor

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!

@mjuarez-ford
Copy link
Contributor Author

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

@joeljfischer
Copy link
Contributor

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.

@mjuarez-ford
Copy link
Contributor Author

Thanks so much for the feedback @joeljfischer.

@mjuarez-ford
Copy link
Contributor Author

Hi @joeljfischer is there any news regarding this issue?

@joeljfischer
Copy link
Contributor

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

joeljfischer added a commit to smartdevicelink/sdl_ios that referenced this issue Apr 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants