smartdevicelink / sdl_core

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

ResumeController considers WARNINGS with message as reason to fail resumption #3660

Closed collinmcq closed 3 years ago

collinmcq commented 3 years ago

Bug Report

An HMI response with "message", regardless of result code, will be considered by the resumption controller as unsuccessful, causing resumption to fail and these responses to not be reverted.

Reproduction Steps
  1. Start SDL Core and SDL HMI
  2. Connect Mobile App
  3. Mobile App Sends an AddCommand with a DYNAMIC image that does not exist on the file system
  4. Mobile App reconnects using the last hashID it received
Expected Behavior

SUCCESS response to RAI, AddCommand resumed

Observed Behavior

RESUME_FAILED response to RAI, AddCommand that got WARNINGS was not reverted

Test Case, Sample Code, and / or Example App

ATF Test with slight modifications:

diff --git a/test_scripts/Resumption/Handling_errors_from_HMI/027_resume_all_data_with_one_error_rpc_unexpected_disconnect_different_resultCodes.lua b/test_scripts/Resumption/Handling_errors_from_HMI/027_resume_all_data_with_one_error_rpc_unexpected_disconnect_different_resultCodes.lua
index 56891c56..b2bf4801 100644
--- a/test_scripts/Resumption/Handling_errors_from_HMI/027_resume_all_data_with_one_error_rpc_unexpected_disconnect_different_resultCodes.lua
+++ b/test_scripts/Resumption/Handling_errors_from_HMI/027_resume_all_data_with_one_error_rpc_unexpected_disconnect_different_resultCodes.lua
@@ -66,7 +66,7 @@ local function reRegisterApp(pAppId, pErrorCode)
     end)
   common.getHMIConnection():ExpectRequest("UI.AddSubMenu",common.resumptionData[pAppId].addSubMenu.UI)
   :Do(function(_, data)
-      common.getHMIConnection():SendError(data.id, data.method, pErrorCode, "info message")
+      common.getHMIConnection():SendError(data.id, data.method, pErrorCode)
     end)

   common.resumptionFullHMILevel(pAppId)
dboltovskyi commented 3 years ago

@iCollin Please notice WARNINGS code is a successful one and needs to be sent from HMI with SendResponse() function which creates successful response structure. This result code is covered in 002_successful_resumption_other_successful_result_codes script.

From other hand SendError() creates an erroneous structure, so the whole message is treated by SDL as erroneous one, and hence SDL fails resumption.

As for https://github.com/smartdevicelink/sdl_atf_test_scripts/pull/2529 it looks like TRUNCATED_DATA is a successful one and that's correct - it's need to be removed from the erroneous list. Though it may be need to be added to 002 script.

collinmcq commented 3 years ago

@dboltovskyi thank you, I have made changes to 002 script to include TRUNCATED_DATA.