[Bug] Generated Dataverse delete() discards IOperationResult, so failed deletes are silent
Maintainer thường phản hồi trong vòng 1 ngày
@ergonza93 đang làm issue này rồi.
Từ ngày 1/10/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Describe the bug
For Dataverse tables, the generated service's delete() method is typed Promise<void> and discards the IOperationResult<void> that client.deleteRecordAsync returns. deleteRecordAsync reports failure through success: false and error instead of throwing, so when Dataverse refuses a delete the failure is silently lost and callers cannot tell the delete did not happen.
create, update and get in the same generated file all return result, so only delete is inconsistent.
Generated code today:
public static async delete(id: string): Promise<void> {
await Contoso_projectsService.client.deleteRecordAsync(
Contoso_projectsService.dataSourceName,
id);
}
The generator template is in @microsoft/power-apps-cli (the Dataverse service generator): the delete template emits await ...deleteRecordAsync(...) with no return, unlike the update template.
Steps to Reproduce
- Create a code app with Dataverse tables where a parent table has a Restrict-delete relationship to a child table (e.g.
contoso_project->contoso_task, with the child's lookup to the parent set to "Restrict" on delete). - Add both tables with
pa app add data-source --connector dataverse --table <name>. - Create a parent row and a child row that references it.
- Call
Contoso_projectsService.delete(parentId)from the app. - Observe: the promise resolves normally, nothing is thrown, and the parent row still exists in Dataverse.
Expected behavior
delete should surface the failure the same way the other operations do: return Promise<IOperationResult<void>> (so callers can check success and error), or throw when success is false.
Actual behavior
delete resolves with undefined regardless of outcome. The error is discarded inside the generated wrapper, so UIs behave as if the delete succeeded.
Screenshots or Error Messages
None: the point of the bug is that no error is surfaced. Calling the client directly and checking the result does show the failure:
const result = await client.deleteRecordAsync('contoso_projects', id);
// result.success === false, result.error.message describes the blocked delete
Environment information
- Framework, build tool or relevant package used: React 19, Vite 7,
@microsoft/power-apps1.2.12 (also type-checked against 1.5.0),@microsoft/power-apps-cli0.15.2 (also inspected 1.2.0),@microsoft/power-apps-vite1.0.2 (also 1.0.13) - Any connection/components: Dataverse (generated services via
pa app add data-source/pa app refresh data-source)
Additional context
- The behaviour was observed in an app generated with CLI 0.15.2 / runtime 1.2.12. I then regenerated with CLI 1.2.0 and read the generated output and the runtime 1.5.0 typings:
deleteis stillPromise<void>anddeleteRecordAsyncis still typedPromise<IOperationResult<void>>, so it is not fixed in the latest versions I checked. I did not re-run the repro itself on 1.5.0. - Workaround: bypass the generated
deleteand callgetClient(dataSourcesInfo).deleteRecordAsync(tableName, id)directly, throwing whenresult.successis false. Editing the generated file is not viable because it is overwritten on the next refresh. - Suggested fix: change the
deletetemplate in both the standard andpartitionIdvariants to return the result, e.g.Promise<IOperationResult<void>>andreturn result;, matchingupdate.
- Ngôn ngữ chính
- TypeScript
- Star
- 513
- Fork
- 143
- Merge trung bình
- 1 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 11
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/PowerAppsCodeApps
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
microsoft/PowerAppsCodeApps#472 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] shared_odbc with on-prem fails pointing to placeholder URLCó thể đã có người làm @tonystevenj đã nhận 3 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
microsoft/PowerAppsCodeApps#465 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug] Power App Code App doesn't run in China 21V cloud even with the toggle enabledCó thể đã có người làm @tonystevenj đã nhận 6 ngày trước. Đang mởbug product team investigating
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
microsoft/PowerAppsCodeApps#463 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
microsoft/PowerAppsCodeApps#461 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
microsoft/PowerAppsCodeApps#460 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/PowerAppsCodeApps
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
xdjs/MusicNerdWeb#1532 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
sebastian-software/ardo#352 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
@react95/core good first issue
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 3 ngày
-
@shikijs/stream: `ShikiStreamTokenizer.clone()` shares its `tokensStable` array with the originalCó thể đã có người làm @xyrolle đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 6 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày