fix(vscode): Fix Workflow save, token persistence#9406
Open
bjbennet wants to merge 6 commits into
Open
Conversation
Contributor
🤖 AI PR Validation ReportPR Review ResultsThank you for your submission! Here's detailed feedback on your PR title and body compliance:✅ PR Title
✅ Commit Type
✅ Risk Level
✅ What & Why
|
| Section | Status | Recommendation |
|---|---|---|
| Title | ✅ | No change needed |
| Commit Type | ✅ | No change needed |
| Risk Level | ✅ | Medium is correct |
| What & Why | ✅ | Optionally remove local file links |
| Impact of Change | Fill in Users/Developers/System | |
| Test Plan | ✅ | Unit tests confirmed |
| Contributors | Credit collaborators if any | |
| Screenshots/Videos | Not required (non-visual change) |
✅ This PR passes all required checks and is clear to merge. Please address the warnings (especially the empty Impact of Change section) as a courtesy, but they do not block the merge.
Powered by: Copilot CLI (claude-opus-4.8) | Last updated: Fri, 17 Jul 2026 22:45:20 GMT
Contributor
There was a problem hiding this comment.
Pull request overview
This PR targets reliability issues in the VS Code-hosted Logic Apps designer, focusing on preventing save failures caused by stale auth tokens and avoiding silent data loss during workflow/parameter serialization and persistence.
Changes:
- Added periodic access-token refresh in the VS Code extension host and propagated token updates into the webview/Redux state.
- Adjusted workflow parameter deserialization to avoid dropping values when JSON parsing fails.
- Updated save/dirty-state handling and added/updated unit tests around save and auth-token behavior.
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| Localize/lang/strings.json | Removes a set of localization entries (appears to be cleanup of unused strings). |
| libs/vscode-extension/src/lib/services/httpClient.ts | Adds updateAccessToken() to allow token updates after client construction. |
| libs/vscode-extension/src/lib/services/test/httpClient.spec.ts | Adds auth-header behavior tests for ARM vs non-ARM requests. |
| libs/designer/src/lib/core/actions/bjsworkflow/serializer.ts | Returns raw parameter value on JSON parse failure to prevent silent loss. |
| libs/designer-v2/src/lib/core/actions/bjsworkflow/serializer.ts | Same parameter parsing behavior change as designer v1. |
| eslint.config.mjs | Adds import/ignore: ["node_modules"] setting. |
| apps/vs-code-react/src/webviewCommunication.tsx | Wires update_access_token message to update designer panel metadata token state. |
| apps/vs-code-react/src/state/DesignerSlice.ts | Adds updateDesignerAccessToken reducer to keep panelMetaData.accessToken updated. |
| apps/vs-code-react/src/app/designer/appV2.tsx | Removes premature dirty-state clearing from the designer save path. |
| apps/vs-code-react/src/app/designer/test/designerCommandBarSave.spec.tsx | Adds unit tests covering save validation and save-disabled conditions. |
| apps/vs-code-designer/src/app/utils/codeless/test/saveWorkflow.test.ts | Adds tests for save serialization and file-write behavior (currently needs mocking fixes). |
| apps/vs-code-designer/src/app/utils/codeless/test/getAuthorizationToken.test.ts | Adds tests for token acquisition behavior (currently encodes “Bearer undefined” behavior). |
| apps/vs-code-designer/src/app/commands/workflows/openDesigner/openDesignerForLocalProject.ts | Adds token refresh interval + parameter merge behavior changes. |
14 tasks
14 tasks
Copilot AI
added a commit
that referenced
this pull request
Jul 17, 2026
- Remove _clearDirtyState parameter from saveWorkflow (Fix 1)
- Guard against Authorization: undefined in httpClient (Fix 2)
- Fix httpClient.spec.ts to expect header omission (Fix 3)
- Fix updateDesignerAccessToken to accept string | undefined (Fix 4)
- Add 30-min access token refresh interval to localDesignerPanel (Fix 5)
- Deep-merge mergeJsonParameters to preserve file-only properties (Fix 6)
- Fix saveWorkflow.test.ts to mock writeFileSync via vi.mock('fs') (Fix 7)
- Fix getAuthorizationToken to return '' instead of '******' (Fix 8)
- Add comment explaining dual dispatch in webviewCommunication (Fix 9)
- Add test files: getAuthorizationToken.test.ts, saveWorkflow.test.ts, designerCommandBarSave.spec.tsx
14 tasks
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI
added a commit
that referenced
this pull request
Jul 17, 2026
Fixes review comment r3597382245 on PR #9406: - getAuthorizationToken now throws an error when accessToken is undefined/empty instead of returning '******' - Remove redundant optional chaining on the return statement - Add test file verifying the function throws (instead of the previous unsafe assertion toBe('******') on line 46)
Contributor
Author
|
@copilot resolve the merge conflicts in this pull request |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Commit Type
Risk Level
What & Why
Fix 1 — Token Expiration (3 files):
httpClient.ts — Added updateAccessToken() method so the token can be refreshed after construction
openDesignerForLocalProject.ts — Added 5-second interval that refreshes the access token and posts update_access_token to the webview (mirroring the existing Overview panel pattern). Cleared on dispose.
DesignerSlice.ts + webviewCommunication.tsx — Added updateDesignerAccessToken reducer and wired it to the update_access_token message handler so that panelMetaData.accessToken updates → triggering useMemo to recreate the HttpClient with the fresh token
Fix 2a — Silent Data Loss (1 file):
appV2.tsx — Removed premature clearDirtyState?.() call. The extension host already sends resetDesignerDirtyState only after a successful file write.
Fix 2b — Parameter Value Loss (2 files):
serializer.ts and serializer.ts — Changed parseWorkflowParameterValue to return parameterValue (raw string) on JSON.parse failure instead of undefined, preventing silent data loss.
Fix 3 — Field Mappings Removed (1 file):
openDesignerForLocalProject.ts — Enhanced mergeJsonParameters to deep-merge: when a parameter key exists in both the file and designer output, file-only properties are preserved (backfilled into the designer output).
Impact of Change
Test Plan
Contributors
Screenshots/Videos