smartdevicelink / sdl_core

SmartDeviceLink In-Vehicle Software and Sample HMI
BSD 3-Clause "New" or "Revised" License
240 stars 245 forks source link

SDL rejects SystemRequest from mobile App during PTU #3862

Closed VjKlepikov closed 2 years ago

VjKlepikov commented 2 years ago

Bug Report

SDL rejects SystemRequest from mobile App during PTU

Reproduction Steps
  1. Core and HMI are started
  2. App1 and App2 are registered
  3. Core sends OnStatusUpdate UPDATING
  4. SDL send OnSystemRequest to APP1
  5. App1 sends SystemRequest(HTTP) to SDL on OnSystemRequest notification
Expected Behavior

SDL sends SystemRequest(SUCCESS) response to mobile App

Observed Behavior

SDL rejects SystemRequest from mobile App1

OS & Version Information
Test Case, Sample Code, and / or Example App

./test_scripts/Policies/build_options/079_ATF_PTU_HMI_Level_Affected_Apps_NONE_BACKGROUND_HTTP.lua ./test_scripts/TheSameApp/Policies/AppId/002_PTU_is_triggered_after_registration_app_with_different_app_id.lua

Logs:
Logs.zip

VjKlepikov commented 2 years ago

Please notice this is a regression issue that became reproducible after merge of #3853

iCollin commented 2 years ago

Hello @VjKlepikov,

Are you sure this is an issue with Core? From a quick look at both tests, I see the log PolicyHandler::IsPTUSystemRequestAllowed: PTU received from unexpected application, request was sent to 0 It seems to me that the tests will need additional updates to trigger Core to send OnSystemRequest to the application which will provide the PTU in SystemRequest. Per 0337 an app may not PTU unless Core has specifically requested an update with OnSystemRequest.

I will look at adding the newly required updates to these tests now. Please let me know if I have misunderstood.

Thank you!

iCollin commented 2 years ago

@VjKlepikov I do see the Core issue now, my mistake. The last_ptu_app_id_ is not being updated by OnSystemRequest notifications from the HMI in HTTP policy mode. I will create a fix to address this now.

I believe updates to the at least some of the scripts will also be necessary to send OnSystemRequest from the HMI to SDL with the proper app ID and/or reply from the correct app.

iCollin commented 2 years ago

Closed via https://github.com/smartdevicelink/sdl_core/pull/3863