[Bug] Generated Dataverse delete() discards IOperationResult, so failed deletes are silent
維護者通常 1 天內回覆
@ergonza93 已經在處理了。
開始於 2026年10月1日。
評估
這個 Issue 還沒有評估資料。
描述
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.
- 主要語言
- TypeScript
- 星號
- 513
- 分支
- 143
- 平均合併
- 3 天 9 小時
- 30 天內合併 PR
- 12
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
microsoft/PowerAppsCodeApps 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 22/100
microsoft/PowerAppsCodeApps#472 ·
維護者通常 1 天內回覆
-
[Bug] shared_odbc with on-prem fails pointing to placeholder URL可能已有人在做 @tonystevenj 於 2 天前認領。 未關閉bug
難度 4/5 3-5 天 新手友好度 45/100
microsoft/PowerAppsCodeApps#465 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
[Bug] Power App Code App doesn't run in China 21V cloud even with the toggle enabled可能已有人在做 @tonystevenj 於 4 天前認領。 未關閉bug product team investigating
難度 4/5 3-5 天 新手友好度 35/100
microsoft/PowerAppsCodeApps#463 · 1 則留言 · 已指派 1 人 ·
維護者通常 1 天內回覆
-
bug
難度 4/5 3-5 天 新手友好度 48/100
microsoft/PowerAppsCodeApps#461 ·
維護者通常 1 天內回覆
-
bug
難度 5/5 一週以上 新手友好度 28/100
microsoft/PowerAppsCodeApps#460 · 3 則留言 ·
維護者通常 1 天內回覆
查看 microsoft/PowerAppsCodeApps 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆
-
high priority
難度 2/5 1-3 小時 新手友好度 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 則留言 ·
-
Create/import wallet form shows raw "password must be at least 1 characters" instead of the translated message可能已有人在做 @CapThunder19 今天認領。 未關閉bug
難度 2/5 1-3 小時 新手友好度 82/100
joinmarket-webui/jam#1538 ·
維護者通常 1 天內回覆
-
t0ggles
難度 2/5 1-3 小時 新手友好度 70/100
nolimits4web/swiper#8240 · 1 則留言 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
維護者通常 1 天內回覆