Backtracking is not working (Deeplinking)

Hi, I was trying to enable backtracking in the example router app found here

Link to repo:

and looks like the built in backtracking feature is not working

I tried to enable it by setting backtracking to true in the settings.json

Link to docs:

settings.json

 "platformSettings": {
    "log": true,
    "path": "./static",
    "disableTransitions": false,
    "showVersion": true,
    "inspector": false,
    "router": {
      "backtracking": true,
      "gcOnUnload": true,
      "lazyCreate": true,
      "lazyDestroy": true,
      "reuseInstance": false,
      "logRoute": false,
      "updateHash": true
    }
  }

I navigated to /#home/search/ => The page rendered fine and on hitting back instead of navigating to /#home the app got closed.

lightning version: “@lightningjs/sdk”: “5.2.0”

Can someone help me to get this enabled

Hi!

First - I don’t think backtracking setting does anything. I’ll file a bug with the SDK but I only see docs for it and no code related to the flag doing anything.

If you deep linked into the app, you may want to first go to the homepage and then ‘navigate’ from home page to the deep linked page so history is added to the router.

You can debug _handleAppClose function is probably getting called:

You could change the logic to just navigate to Home instead, but you’ll need some way to exit your app.

So the documentation is wrong - try changing the flag to backtrack - we’ll work on getting the docs updated. Thanks!

Thank you for the quick response. In our case, we ended up falling into the scenario mentioned by Ricardo Alves where we have to place the logic for this in _handleAppClose