rdkcentral / Lightning-SDK

SDK for Lightning framework
Apache License 2.0
130 stars 69 forks source link

Backtracking docs with no matching code #375

Closed chiefcll closed 1 year ago

chiefcll commented 1 year ago

Under deeplinking - there is a backtracking flag https://rdkcentral.github.io/Lightning-SDK/#/plugins/router/deeplinking?id=backtracking

However, there is no actual code based on that flag. So either something needs adding to the code or the docs need removing.

https://forum.lightningjs.io/t/backtracking-is-not-working-deeplinking/573

ricardo-a-alves-alb commented 1 year ago

The property is backtrack and not backtracking, the documentation is incorrect.

You can see some of the relevant code here:

https://github.com/rdkcentral/Lightning-SDK/blob/2b0d10e6d36ae9d855d8f0ac29e8eaccae807ebf/src/Router/index.js#L380-L397

However, this feature doesn't work for a specific use-case, for example:

Routes configuration:

{
  root: 'home',
  routes: [
    {
      path: 'home',
      component: Home,
      widgets: ['Menu'],
    },
    {
      path: 'settings',
      component: Settings,
      widgets: ['Menu'],
    },
  ],
}

However, if we start the app on #settings route (eg.: deeplink) and then we try the Router.back() the _handleAppClose method will be called, when it should navigate to # that acts the same as #home because it is defined as the root path of the app.

chiefcll commented 1 year ago

Thanks! I'll work on updating the docs.