Repository navigation
Fix knowledge file sync - #527
Hoa Nguyen (nguhoa) wants to merge 3 commits into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0a661635-bab8-4535-9e6e-5eb3e45d0476
There was a problem hiding this comment.
🟡 Changes recommended
Concurrent local and cloud edits to a knowledge file’s description can silently overwrite the local description during pull because attachment metadata conflicts are not detected.
1 open issue
What changed in this PR
This PR improves knowledge-file synchronization between local Copilot Studio workspaces and Dataverse, covering sidecar descriptions, cloud replacements, and upload filenames.
Changes:
- Reads authored descriptions and preserves local metadata edits when the cloud only reuploads file content.
- Protects replacement files during deletion cleanup and supports filenames that cannot be sent in HTTP headers.
- Adds regression tests for metadata, replacement, and push-retry behavior.
| File | Description |
|---|---|
src/CopilotStudio.Sync/WorkspaceSynchronizer.cs |
Updates metadata handling, retry downloads, and replacement-safe cleanup. |
src/CopilotStudio.Sync/Dataverse/SyncDataverseClient.cs |
Uses an encoded query parameter for header-incompatible filenames. |
src/CopilotStudio.Sync/ConnectionReferenceStore.cs |
Extracts a read helper for already-listed files. |
src/CopilotStudio.Sync.UnitTests/SkillFolderLayoutTests.cs |
Tests skill asset replacements and authored descriptions. |
src/CopilotStudio.Sync.UnitTests/PushConcurrencyRetryTests.cs |
Tests knowledge-file metadata and payload handling during retries. |
src/CopilotStudio.Sync.UnitTests/KnowledgeFileUnifyTests.cs |
Tests description edits, reuploads, and replacement cleanup. |
src/CopilotStudio.Sync.UnitTests/Dataverse/DataverseRetryPolicyTests.cs |
Tests filename transport through headers and query parameters. |
src/CopilotStudio.Sync.UnitTests/CliAgentRoundTripReadTests.cs |
Allows shared sync infrastructure in fixture setup. |
Review effort: Balanced
|
Review finding: [P1] Pull can silently discard a locally edited knowledge-file description Reviewed commit: In Reproduction:
The remote deletion remains in the merged changeset, so Requested change: Treat a remote deletion against a local knowledge-file description update as a conflict, preserve the local files for resolution, and add an end-to-end pull regression covering that sequence. I would block merging on this data-loss path. This finding is based on the visible source and callers; no external dependencies were decompiled. |

Fix knowledge file sync