mirror of
https://github.com/microsoft/playwright-mcp.git
synced 2025-07-26 08:32:26 +08:00
Fix race condition bug in session file check
Co-authored-by: pavelfeldman <883973+pavelfeldman@users.noreply.github.com>
This commit is contained in:
parent
bb9de30ef9
commit
e35f0ac562
@ -148,13 +148,17 @@ export class Context {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _logSessionEntry(toolName: string, params: Record<string, unknown>, snapshotFile?: string) {
|
private async _logSessionEntry(toolName: string, params: Record<string, unknown>, snapshotFile?: string) {
|
||||||
if (!this.config.saveSession || !this._sessionFile)
|
if (!this.config.saveSession)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Ensure session file is initialized before proceeding
|
// Ensure session file is initialized before proceeding
|
||||||
if (this._sessionFileInitialized)
|
if (this._sessionFileInitialized)
|
||||||
await this._sessionFileInitialized;
|
await this._sessionFileInitialized;
|
||||||
|
|
||||||
|
// After initialization, session file should always be defined when saveSession is true
|
||||||
|
if (!this._sessionFile)
|
||||||
|
throw new Error('Session file not initialized despite saveSession being enabled');
|
||||||
|
|
||||||
const entry = [
|
const entry = [
|
||||||
`- ${toolName}:`,
|
`- ${toolName}:`,
|
||||||
' params:',
|
' params:',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user