Skip to content

Fix: RequestHelper silently swallows non-2xx responses, causing false success on Upload & Publish - #343

Draft
Power-Maverick with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-upload-publish-reports
Draft

Fix: RequestHelper silently swallows non-2xx responses, causing false success on Upload & Publish#343
Power-Maverick with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-upload-publish-reports

Conversation

Copilot AI commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

RequestHelper.requestData/postData/patchData returned undefined for any non-2xx, non-401 response. Callers like uploadWebResourceInternal never entered their catch block and unconditionally showed the success toast — even when the PATCH or PublishXml was rejected server-side (lock conflicts, permission errors, 503s, etc.).

Changes

  • requestHelper.ts: Replace return undefined in the non-Unauthorized error branch of all three HTTP methods with a call to a new raiseResponseError helper that throws instead.
  • raiseResponseError (new private method): Parses the Dataverse JSON error body (error.message / error.code) and throws with the server's human-readable message; falls back to Request failed with status {N} if the body is unparseable.
  • Removed the unused redirectTimeout stub.
// Before — failure silently discarded
} else {
    return undefined;
}

// After — server error surfaced to caller
} else {
    await this.raiseResponseError(response);
}

The existing catch in uploadWebResourceInternal already shows ErrorMessages.wrUploadError and logs the error — no changes needed there. Dataverse lock-conflict messages (e.g. "A solution import is in progress") will now appear verbatim in the error toast.

… undefined

Co-authored-by: Power-Maverick <36135520+Power-Maverick@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix upload and publish notifications to reflect actual status Fix: RequestHelper silently swallows non-2xx responses, causing false success on Upload & Publish Aug 18, 2026
Copilot AI requested a review from Power-Maverick August 18, 2026 02:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Upload & Publish reports success when the update or publish actually fails

2 participants