File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/app/service/offscreen Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -184,8 +184,9 @@ export class VSCodeConnect {
184184 private connectTimerId : ReturnType < typeof setTimeout > | null = null ;
185185 private reconnectTimerId : ReturnType < typeof setTimeout > | null = null ;
186186
187- /** * epoch 用于确保非同步回调的时效性
188- * 每次发起新连接时都会递增,旧的 epoch 回调会被忽略
187+ /**
188+ * * epoch 用于确保非同步回调的时效性
189+ * * 每次发起新连接时都会递增,旧的 epoch 回调会被忽略
189190 */
190191 private epoch = 0 ;
191192 private lastParams : VSCodeConnectParam | null = null ;
@@ -212,7 +213,7 @@ export class VSCodeConnect {
212213 * 建立或替换 WebSocket 连接
213214 */
214215 private async connect ( params : VSCodeConnectParam ) : Promise < void > {
215- const currentEpoch = ++ this . epoch ;
216+ const currentEpoch = ( this . epoch = ( this . epoch & 255 ) + 1 ) ;
216217 this . lastParams = { ...params } ;
217218
218219 this . cleanup ( ) ;
You can’t perform that action at this time.
0 commit comments