Skip to content

Add debug logs when writing to persistent storage (#18288) - #26161

Open
Shriraj Jadhav (Shriraj1901) wants to merge 1 commit into
microsoft:mainfrom
Shriraj1901:add-debug-logs-persistent-storage
Open

Shriraj Jadhav (Shriraj1901) wants to merge 1 commit into
microsoft:mainfrom
Shriraj1901:add-debug-logs-persistent-storage

Conversation

@Shriraj1901

Copy link
Copy Markdown

Adds traceVerbose logging calls at the two write paths in persistentState.ts:

  • PersistentState.updateValue() — the core write path used by both global and workspace persistent state
  • updateWorkspaceStateValue() — a separate direct write path

This makes it easier to diagnose issues related to persistent storage writes, following the same pattern already used for traceError in this file.

How this was verified

  • eslint and prettier --check pass cleanly on the changed file
  • tsc --noEmit compiles with no errors
  • Pre-existing test failures in testing/utils.unit.test.js were confirmed unrelated to this change (same failures reproduce with this change stashed out, via git stash)

Fixes #18288

Adds traceVerbose logging calls at the two write paths in
persistentState.ts:
- PersistentState.updateValue() - the core write path used by
  both global and workspace persistent state
- updateWorkspaceStateValue() - a separate direct write path

This makes it easier to diagnose issues related to persistent
storage writes, as requested in the issue.

Verified: eslint and prettier pass cleanly on the changed file,
tsc compiles with no errors, and pre-existing test failures in
testing/utils.unit.test.js were confirmed unrelated (same
failures occur with this change stashed out).
@bschnurr

Bill Schnurr (bschnurr) commented Sep 22, 2026

Copy link
Copy Markdown
Member

🔒 Automated review in progress — Bill Schnurr (@bschnurr) is auto-reviewing this PR.

@bschnurr

Copy link
Copy Markdown
Member

Result: ⚠️ needs-more-tests

Verification details

Verification: Isolated verification observed failures that were not classified as caused by this PR: TypeScript compilation. The relevant tests could not be fully run in the isolated environment; this review is not fully verified.

Summary: Offline dependency installation succeeded, and targeted ESLint and Prettier checks passed. TypeScript compilation did not run because the command referenced a nonexistent `typescript/bin/tsc.js`, an invocation issue unrelated to the PR. Consequently, the persistent-state unit suite could not be executed. Existing tests exercise writes but do not assert either newly added verbose log, so the logging behavior needs dedicated coverage.

Test runs: 4 passed, 1 failed, 1 not run

  • Failed | unrelated to this PR | TypeScript compilation | node ./node_modules/typescript/bin/tsc.js -p ./tsconfig.json
  • ⚠️ Not run | Persistent-state unit tests | node ./node_modules/mocha/bin/mocha.js --require out/test/unittests.js --ui tdd --timeout 180000 out/test/common/persistentState.unit.test.js
  • Passed | ESLint for persistentState.ts | node ./node_modules/eslint/bin/eslint.js src/client/common/persistentState.ts
  • Passed | Prettier check for persistentState.ts | node ./node_modules/prettier/bin-prettier.js --check src/client/common/persistentState.ts
  • Passed | Dependency and test-runner discovery | printf 'profile=%s\n' "$AUTOMATION_SANDBOX_PROFILE"; git diff --name-status HEAD^ HEAD; test -d node_modules && echo 'node_modules=present' || echo 'node_modules=missing'; node --version; npm --version; node -e "const p=require('./package.json'); console.log(JSON.stringify({scripts:{compile:p.scripts.compile,compileTests:p.scripts['compile-tests'],unit:p.scripts['test:unittests'],lint:p.scripts.lint,format:p.scripts['format-check']}}))"; cat build/.mocha.unittests.json
  • Passed | Offline dependency bootstrap | npm ci --offline
TypeScript compilation diagnostic output
Error: Cannot find module '/workspace/node_modules/typescript/bin/tsc.js'
Node.js v22.21.1
⚠️ Persistent-state unit tests diagnostic output
Not run because compilation did not produce the required out/test files.

@bschnurr Bill Schnurr (bschnurr) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved via Review Center.

@bschnurr Bill Schnurr (bschnurr) added the review-auto:approved Automated review: no blocking findings (approval posted). label Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review-auto:approved Automated review: no blocking findings (approval posted).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tech debt: Add debug logs when writing to persistent storage

2 participants