Fix issue with deep linking not working due to session data race condition
This commit is contained in:
1 parent
13cd469400
commit
3ca87dc1d4
5 files changed
+50
-4
No files matched your search
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Issue with deep linking not working due to session data race condition
|
||||
|
||||
## [0.40.4] - 2025-06-17
|
||||
|
||||
### Fixed
|
||||
|
||||
@@ -1,9 +1,27 @@
|
||||
import "pkg:/components/Services/Innertube/Constants.bs"
|
||||
import "pkg:/source/AsyncTask/AsyncTask.bs"
|
||||
import "pkg:/source/AsyncTask/Tasks.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
|
||||
function Init()
|
||||
AsyncTask.Start(Tasks.InnertubeInitTask, {
|
||||
OnRequestVisitorData()
|
||||
end function
|
||||
|
||||
function OnRequestVisitorData() as void
|
||||
if m.innertubeInitTask <> invalid
|
||||
return
|
||||
end if
|
||||
|
||||
visitorData = m.top.visitorData
|
||||
if not StringUtils.IsNullOrEmpty(visitorData)
|
||||
return
|
||||
end if
|
||||
|
||||
m.innertubeInitTask = AsyncTask.Start(Tasks.InnertubeInitTask, {
|
||||
innertube: m.top
|
||||
})
|
||||
}, OnInnertubeInitTaskResult)
|
||||
end function
|
||||
|
||||
function OnInnertubeInitTaskResult(output as object) as void
|
||||
m.innertubeInitTask = invalid
|
||||
end function
|
||||
@@ -3,5 +3,6 @@
|
||||
<field id="timestamp" type="int" />
|
||||
<field id="visitorData" type="string" />
|
||||
<field id="poToken" type="string" />
|
||||
<field id="requestVisitorData" type="boolean" alwaysNotify="true" onChange="OnRequestVisitorData" />
|
||||
</interface>
|
||||
</component>
|
||||
@@ -24,10 +24,26 @@ function VideoContentTask(input as object) as object
|
||||
metadata = contentNode.metadata
|
||||
if not IsAssociativeArray(metadata)
|
||||
if backend = "playlet"
|
||||
visitorData = innertubeNode.visitorData
|
||||
if StringUtils.IsNullOrEmpty(visitorData)
|
||||
messagePort = CreateObject("roMessagePort")
|
||||
MessagePortUtils.ObserveFieldScopedExSafe(innertubeNode, "visitorData", messagePort)
|
||||
innertubeNode.requestVisitorData = true
|
||||
message = wait(10000, messagePort)
|
||||
innertubeNode.unobserveFieldScoped("visitorData")
|
||||
if message = invalid
|
||||
return {
|
||||
success: false
|
||||
error: "Failed to get visitor data. Please try again later."
|
||||
}
|
||||
end if
|
||||
visitorData = message.getData()
|
||||
end if
|
||||
|
||||
metadata = InnertubeService.GetVideoMetadata(contentNode.videoId, {
|
||||
"cancellation": m.top.cancellation
|
||||
"credentialTransferToken": loungeServiceNode.credentialTransferToken
|
||||
"visitorData": innertubeNode.visitorData
|
||||
"visitorData": visitorData
|
||||
})
|
||||
else
|
||||
metadata = service.GetVideoMetadata(contentNode.videoId, { cancellation: m.top.cancellation })
|
||||
|
||||
@@ -11,15 +11,20 @@ const config = getEnvVars(['ROKU_DEV_TARGET']);
|
||||
});
|
||||
|
||||
parser.add_argument('--app-id', { help: 'App Id' });
|
||||
parser.add_argument('--query', { help: 'Query parameters to append to the URL' });
|
||||
|
||||
const args = parser.parse_args();
|
||||
let appId = args.app_id || "dev";
|
||||
const query = args.query || "";
|
||||
|
||||
if (appId === "prod") {
|
||||
appId = "693751";
|
||||
}
|
||||
|
||||
const url = `http://${config.ROKU_DEV_TARGET}:8060/launch/${appId}?restart=true`;
|
||||
let url = `http://${config.ROKU_DEV_TARGET}:8060/launch/${appId}?restart=true`;
|
||||
if (query) {
|
||||
url += `&${query}`;
|
||||
}
|
||||
console.log("Restarting app", appId);
|
||||
await fetch(url, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in new issue
Block a user