Skip to content

Uncaught (in promise) TypeError: Cannot read properties of null (reading '0') during Alert request #526

@VjKlepikov

Description

@VjKlepikov

Bug Summary

Uncaught (in promise) TypeError: Cannot read properties of null (reading '0') during Alert request

Reproduction Steps

  1. Core is built with DWEBSOCKET_SERVER_TRANSPORT_SUPPORT set to `true

  2. SmartDeviceLink.ini file is modified: ;WSServerCertificatePath = server-cert.pem ;WSServerKeyPath = server-key.pem ;WSServerCACertificatePath = ca-cert.pemare commented out

  3. 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"}

  4. SDL and HMI are started

  5. In HMI folder, run ./deploy_server.sh as a back-end process

  6. 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"
}

  1. 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

  1. 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

  2. Activate a Web app (WEB_VIEW) on the HMI

  3. 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" )

  4. 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

Logs.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions