Repository navigation
Fix push custom connector issue - #535
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Replacing atomic conditional writes with read-before-write checks risks overwriting concurrent cloud edits, requiring human acceptance of the tradeoff and live Dataverse validation beyond simulated tests.
No open issues 🎉
What changed in this PR
Fixes custom connector pushes in the shared sync layer by avoiding conditional updates that Dataverse rejects, including updates involving connector icons.
Changes:
- Replaces
If-Matchupdates with pre-save version checks and documents their concurrency limitations. - Adds regression coverage for connector updates, icons, version conflicts, and retrying failed pushes.
- Consolidates Dataverse test-client setup into a shared helper.
| File | Description |
|---|---|
src/CopilotStudio.Sync/Dataverse/SyncDataverseClient.cs |
Uses pre-save version reads instead of conditional connector writes. |
src/CopilotStudio.Sync/Dataverse/IDataverseOperations.cs |
Documents the version check’s concurrency limitations. |
src/CopilotStudio.Sync.UnitTests/WorkflowWriteOrderingTests.cs |
Adopts the shared test-client helper. |
src/CopilotStudio.Sync.UnitTests/WorkflowResponseIdentityTests.cs |
Adopts the shared test-client helper. |
src/CopilotStudio.Sync.UnitTests/StandaloneWorkflowDataverseTests.cs |
Tests version checks, unconditional updates, and concurrent-change behavior. |
src/CopilotStudio.Sync.UnitTests/DataverseTestClient.cs |
Adds reusable client setup with immediate retry delays. |
src/CopilotStudio.Sync.UnitTests/DataverseNameQueryTests.cs |
Adopts the shared test-client helper. |
src/CopilotStudio.Sync.UnitTests/DataverseConnectorTable.cs |
Adds a stateful connector-table simulator for HTTP-level tests. |
src/CopilotStudio.Sync.UnitTests/Dataverse/DataverseRetryPolicyTests.cs |
Reuses shared client setup for knowledge-file tests. |
src/CopilotStudio.Sync.UnitTests/CustomConnectorTests.cs |
Tests a successful push after a previous save failure. |
src/CopilotStudio.Sync.UnitTests/CustomConnectorPushTests.cs |
Tests icon-bearing connector updates with and without overwrite. |
src/CopilotStudio.Sync.UnitTests/Copy/CopyDataverseQueryTests.cs |
Adopts the shared test-client helper. |
src/CopilotStudio.Sync.UnitTests/AiPromptPushTests.cs |
Reuses shared setup for the refusing Dataverse client. |
Review effort: Balanced
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
If a connector PATCH commits but returns a 502, 503, or 504 response, the retry mistakes that write’s own version increment for a cloud edit. The push then reports a conflict and retains the old baseline even though the connector was successfully saved.
1 open issue
Review effort: Balanced

Fix push custom connector issue