From f508d879782018b6594d11b14c2636091cd17d5e Mon Sep 17 00:00:00 2001 From: Asuka22687 Date: Mon, 9 Feb 2026 23:40:23 +0900 Subject: [PATCH] fix(debug): align web/app debug status fields across app and service --- .../TizenBrew/service-nextgen/service/index.js | 2 ++ .../service-nextgen/service/utils/debugger.js | 8 ++++++-- .../tizenbrew-ui/src/components/ClientContext.jsx | 3 ++- .../tizenbrew-ui/src/components/WebSocketClient.js | 14 +++++++++++--- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/tizenbrew-app/TizenBrew/service-nextgen/service/index.js b/tizenbrew-app/TizenBrew/service-nextgen/service/index.js index 3e31400..5acbb29 100644 --- a/tizenbrew-app/TizenBrew/service-nextgen/service/index.js +++ b/tizenbrew-app/TizenBrew/service-nextgen/service/index.js @@ -53,6 +53,7 @@ module.exports.onStart = function () { const inDebug = { tizenDebug: false, webDebug: false, + appDebug: false, rwiDebug: false }; @@ -197,6 +198,7 @@ module.exports.onStart = function () { if (mdl.packageType === 'app') { inDebug.webDebug = false; + inDebug.appDebug = false; inDebug.tizenDebug = false; } else { currentModule.mainFile = mdl.mainFile; diff --git a/tizenbrew-app/TizenBrew/service-nextgen/service/utils/debugger.js b/tizenbrew-app/TizenBrew/service-nextgen/service/utils/debugger.js index 2d96011..01b9c05 100644 --- a/tizenbrew-app/TizenBrew/service-nextgen/service/utils/debugger.js +++ b/tizenbrew-app/TizenBrew/service-nextgen/service/utils/debugger.js @@ -48,6 +48,7 @@ function startDebugging(port, queuedEvents, clientConn, ip, mdl, inDebug, appCon inDebug.tizenDebug = false; inDebug.webDebug = false; + inDebug.appDebug = false; inDebug.rwiDebug = false; mdl.fullName = ''; @@ -84,7 +85,10 @@ function startDebugging(port, queuedEvents, clientConn, ip, mdl, inDebug, appCon } } } - if (!isAnotherApp) inDebug.webDebug = true; + if (!isAnotherApp) { + inDebug.webDebug = true; + inDebug.appDebug = true; + } appControlData = null; }).on('error', (err) => { if (attempts >= 15) { @@ -121,4 +125,4 @@ function sendClientInformation(clientConn, data) { }, 500); } -module.exports = startDebugging; \ No newline at end of file +module.exports = startDebugging; diff --git a/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/ClientContext.jsx b/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/ClientContext.jsx index 1138a17..6f71daa 100644 --- a/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/ClientContext.jsx +++ b/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/ClientContext.jsx @@ -5,6 +5,7 @@ const initialState = { sharedData: { debugStatus: { rwiDebug: false, + webDebug: false, appDebug: false, tizenDebug: false }, @@ -48,4 +49,4 @@ export function GlobalStateProvider({ children }) { {children} ); -} \ No newline at end of file +} diff --git a/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/WebSocketClient.js b/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/WebSocketClient.js index d20ce4a..c80320f 100644 --- a/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/WebSocketClient.js +++ b/tizenbrew-app/TizenBrew/tizenbrew-ui/src/components/WebSocketClient.js @@ -73,14 +73,21 @@ class Client { } case Events.GetDebugStatus: { + const normalizedPayload = { + rwiDebug: Boolean(payload && payload.rwiDebug), + webDebug: Boolean(payload && (payload.webDebug || payload.appDebug)), + appDebug: Boolean(payload && (payload.webDebug || payload.appDebug)), + tizenDebug: Boolean(payload && payload.tizenDebug) + }; + const state = this.context.state; - state.sharedData.debugStatus = payload; + state.sharedData.debugStatus = normalizedPayload; this.context.dispatch({ type: 'SET_SHARED_DATA', payload: state.sharedData }); - if (!payload.rwiDebug && !payload.appDebug && !payload.tizenDebug) { + if (!normalizedPayload.rwiDebug && !normalizedPayload.webDebug && !normalizedPayload.tizenDebug) { this.send({ type: Events.CanLaunchInDebug }); @@ -178,6 +185,7 @@ class Client { handleCanLaunchModules(payload) { const debugStatus = this.context.state.sharedData.debugStatus; debugStatus.webDebug = true; + debugStatus.appDebug = true; this.context.dispatch({ type: 'SET_DEBUG_STATUS', payload: debugStatus @@ -243,4 +251,4 @@ class Client { } export { Events }; -export default Client; \ No newline at end of file +export default Client;