Skip to content

Commit 7b661f9

Browse files
committed
refactor: simplify postStateToWebview by removing incremental message delivery logic
1 parent 268ca6b commit 7b661f9

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

src/core/webview/ClineProvider.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ import axios from "axios"
99
import pWaitFor from "p-wait-for"
1010
import * as vscode from "vscode"
1111

12-
// Small delay used for incremental message delivery to the webview
13-
const INCREMENTAL_SEND_DELAY_MS = 10
14-
1512
import {
1613
type GlobalState,
1714
type ProviderName,
@@ -1343,26 +1340,7 @@ export class ClineProvider
13431340

13441341
async postStateToWebview() {
13451342
const state = await this.getStateToPostToWebview()
1346-
1347-
// Check if we're loading an existing task with messages
1348-
const currentCline = this.getCurrentCline()
1349-
const hasExistingMessages = currentCline && currentCline.clineMessages.length > 0
1350-
1351-
if (hasExistingMessages) {
1352-
// Send state without messages first
1353-
const stateWithoutMessages = { ...state, clineMessages: [] }
1354-
await this.postMessageToWebview({ type: "state", state: stateWithoutMessages })
1355-
1356-
// Then send messages incrementally with a small delay for smooth rendering
1357-
for (const message of currentCline.clineMessages) {
1358-
await this.postMessageToWebview({ type: "messageCreated", clineMessage: message })
1359-
// Small delay to prevent overwhelming the webview
1360-
await delay(INCREMENTAL_SEND_DELAY_MS)
1361-
}
1362-
} else {
1363-
// Normal state update for new tasks or tasks without messages
1364-
await this.postMessageToWebview({ type: "state", state })
1365-
}
1343+
await this.postMessageToWebview({ type: "state", state })
13661344

13671345
// Check MDM compliance and send user to account tab if not compliant
13681346
if (!this.checkMdmCompliance()) {

0 commit comments

Comments
 (0)