Uncaught (in promise) TypeError: Cannot read properties of null (reading '0') during Alert request
VjKlepikov opened this issue · 3 comments
Bug Summary
Uncaught (in promise) TypeError: Cannot read properties of null (reading '0') during Alert request
Reproduction Steps
-
Core is built with DWEBSOCKET_SERVER_TRANSPORT_SUPPORT set to `true
-
SmartDeviceLink.ini file is modified: ;WSServerCertificatePath = server-cert.pem ;WSServerKeyPath = server-key.pem ;WSServerCACertificatePath = ca-cert.pemare commented out
-
Update preloaded_pt.json: Add to "app_policies"
{"hello-webengine4": {
"AppHMIType": [ "WEB_VIEW" ],
"keep_context": false,
"steal_focus": false,
"priority": "NONE",
"default_hmi": "NONE",
"groups": ["Base-4", "WidgetSupport"],
"hybrid_app_preference": "CLOUD",
"enabled": false,
"transport_type ": "WS"} -
SDL and HMI are started
-
In HMI folder, run
./deploy_server.sh
as a back-end process -
On HMI → Apps →Apps Store → Set Apps Properties → Available applications → Hello WebEngine3 – Set
( Alternative steps manually: On HMI, go to apps->App Store→Set App Properties )
Add properties for hello-webengine3 app:
{
"nicknames": [
"Hello WebEngine4"
],
"policyAppID": "hello-webengine4",
"enabled": true,
"transportType": "ws",
"hybridAppPreference": "BOTH"
}
- Click Set and make sure that app showed in the apps list ( On HMI → Apps →Apps Store → Set Apps Properties → Set )
HMI → SDL: SetAppProperties ( properties: { nicknames: { "Hello WebEngine4" } , policyAppID:"hello-webengine4", enabled: true, transportType:"ws", hybridAppPreference: "BOTH" }
SDL → HMI : SetAppProperties ( { success:true, resultCode: "SUCCESS" } ))
SDL → HMI: UpdateAppList: (... {"applications":["appName":"Hello WebEngine4"... ] ... )
HMI → SDL : UpdateAppList response { SUCCESS }
The Web app is visible in the main window on the HMI
-
Build SDL.min.js for WebEngine App HMI type WEB_VIEW
Copy the content of folder sdl_javascript_suite/examples/webengine/hello-sdl from https://github.com/smartdevicelink/sdl_javascript_suite to the folder sdl_hmi/web_engine/hello-webengine4
Update manifest.js file with content hello-webengine3 -> hello-webengine4 -
Activate a Web app (WEB_VIEW) on the HMI
-
Change Template to "WEB_VIEW"
Go to -> Options -> Return to WEB_VIEW
App sends "Show" request for the main window with "templateConfiguration" ( "template":"WEB_VIEW" ) -
On HMI press 'Alert command' button
Expected Behavior:
The alert POP-UP is displayed on HMI.
WebApp -> SDL: Alert: {... alertText1:Test Alert ...}
SDL -> HMI: UI.Alert: {"alertStrings":[ {"fieldName":"alertText1","fieldText":"Test Alert"}]... param]}}
HMI -> SDL: UI.OnSystemContext: {"systemContext":"ALERT","appID":..}}
Observed Behavior:
Uncaught (in promise) TypeError: Cannot read properties of null (reading '0') is observed on HMI logs
_PresentAlertOperation.js:458 Uncaught (in promise) TypeError: Cannot read properties of null (reading '0')
at n.value (_PresentAlertOperation.js:458:70)
at n.value (_PresentAlertOperation.js:202:26)
at _PresentAlertOperation.js:121:18
at new Promise ()
at n.value (_PresentAlertOperation.js:107:16)
at n.value (_PresentAlertOperation.js:78:20)
at n.value (_Task.js:76:20)
at n.value (_SubManagerBase.js:303:41)
at n.value (_SubManagerBase.js:249:14)
at n.value (_AlertManagerBase.js:137:14)
Testing Environment(s)
OS/Version: [Ubuntu 18]
SDL Core Version: https://github.com/smartdevicelink/sdl_core/tree/release/8.1.0 (1c79adc)
HMI: https://github.com/smartdevicelink/sdl_hmi/tree/release/5.7.0 (cd2d250)
WebApp: https://github.com/smartdevicelink/sdl_javascript_suite/tree/develop (5972529)
Relevant log output
@crokita Please note that the WebApp does not send Alert requests by press 'Alert command' button on HMI (step 11)
Console HMI logs:
No Images to upload for alert
_PresentAlertOperation.js:144 No audio files need to be uploaded for alert
_PresentAlertOperation.js:249 There was an error presenting the alert: Mandatory parameters are missing
_PresentAlertOperation.js:509 Finishing present alert operation
Logs: Logs2.zip
OS & Version Information:
OS/Version: [Ubuntu 18]
SDL Core Version: https://github.com/smartdevicelink/sdl_core/tree/release/8.1.0 (
6b423eb )
HMI: https://github.com/smartdevicelink/sdl_hmi/tree/release/5.7.0 (31eed2d)
WebApp: https://github.com/smartdevicelink/sdl_javascript_suite/tree/develop (f541e2f)
@VjKlepikov Thanks for the report. This will have to be resolved in a release following 1.6.0. Please make a new issue including the steps you followed and the new error logs you have received above.