You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Extra sanity check due to potential SQL injection below in `subscribe`; should never happen because of openapi-backend's request validation and additional sanitization in `subscribe()`
49
49
thrownewError("deploymentId must be a number.");
50
50
}
@@ -56,7 +56,8 @@ export async function getAppLogs(
56
56
57
57
if(collectLogs||type==="BUILD"){
58
58
constfetchNewLogs=async()=>{
59
-
constnewLogs=awaitdb.deployment.getLogs(
59
+
constnewLogs=awaitdb.app.getLogs(
60
+
app.id,
60
61
deploymentId,
61
62
lastLogId,
62
63
type,
@@ -80,9 +81,14 @@ export async function getAppLogs(
80
81
);
81
82
};
82
83
84
+
constchannel=
85
+
deploymentId===null
86
+
? `app_${appId}_logs`
87
+
: `deployment_${deploymentId}_logs`;
88
+
83
89
// When new logs come in, send them to the client
84
90
constunsubscribe=awaitdb.subscribe(
85
-
`deployment_${deploymentId}_logs`,
91
+
channel,
86
92
()=>
87
93
voidfetchNewLogs().catch((err)=>
88
94
logger.error(err,"Failed to fetch new logs"),
@@ -106,6 +112,11 @@ export async function getAppLogs(
const[hasConnected,setHasConnected]=useState(false);// Whether a connection has been established before; true after the first connection is successfully opened
consturlString=url.toString();// Equal URLs don't have Object.is() equality, so the useEffect would be triggered on every render if we didn't convert this into a string first.
0 commit comments