rdkcentral / Lightning-SDK

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

[Router] Page instances are not detached when navigating back #381

Closed eductech closed 1 year ago

eductech commented 1 year ago

Description:

Normally after calling Router.back() page instance is detached from render tree (lazyDestroy: true).

If we have several items in history and call Router.back() several times to go to root - that results in some pages were rendered over root route page and never detached.

Current solution:

For now we check what Router.isNavigating() returns, and we navigate back only if returns false.

Expected:

Router should detach components when need on its own without Router.isNavigating() check.

Additional data:

{
    "appSettings": {
        "stage": {
            "clearColor": "0x00000000",
            "useImageWorker": false,
            "defaultFontFace": "Inter",
            "precision": 1,
            "w": 1920,
            "h": 1080,
            "pauseRafLoopOnIdle": true
        },
        "enablePointer": true,
        "debug": true
    },
    "platformSettings": {
        "log": false,
        "path": "./static",
        "showVersion": false,
        "inspector": false,
        "showFps": true,
        "esEnv": "es5",
        "router": {
            "backtracking": false,
            "gcOnUnload": true,
            "lazyCreate": true,
            "lazyDestroy": true,
            "destroyOnHistoryBack": false,
            "reuseInstance": true,
            "logRoute": false,
            "updateHash": true,
            "autoRestoreRemote": false
        }
    }
}
    "@lightningjs/core": "2.7.1",
    "@lightningjs/sdk": "5.2.0",
    "@lightningjs/ui-components": "1.3.1",
uguraslan commented 1 year ago

Hey @eductech, thanks for reporting this issue with the Router and providing a detailed description of the problem, as well as your current workaround using Router.isNavigating().

To help us better understand the issue and verify its occurrence, it would be great if you could provide a sample code demonstrating the issue.

sandeep-vedam commented 1 year ago

Hello @eductech ,

We hope this message finds you well. After carefully reviewing this particular issue's progress, it appears there haven't been any recent updates. Therefore, we regret to inform you that we have decided to close this issue for now. However, we want to assure you that we're here to assist you if needed.

To better understand and address the issue you encountered, we kindly request your assistance. If you could provide us with a sample app that clearly illustrates the problem, we would greatly appreciate it. By sharing this additional information, you can help us reopen the issue and work towards finding a resolution.

Thank you for your understanding and cooperation.