[Bug] Generated Dataverse delete() discards IOperationResult, so failed deletes are silent
Maintainer antworten meist innerhalb von 1 Tag
@ergonza93 arbeitet bereits daran.
Seit 01.10.2026.
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 513
- Forks
- 143
- Ø Merge
- 1 T. 1 Std.
- Gemergte PRs (30 T.)
- 11
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus microsoft/PowerAppsCodeApps
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
microsoft/PowerAppsCodeApps#472 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] shared_odbc with on-prem fails pointing to placeholder URLEvtl. vergeben @tonystevenj hat das vor 6 Tagen übernommen. Offenbug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
microsoft/PowerAppsCodeApps#465 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug] Power App Code App doesn't run in China 21V cloud even with the toggle enabledEvtl. vergeben @tonystevenj hat das vor 8 Tagen übernommen. Offenbug product team investigating
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
microsoft/PowerAppsCodeApps#463 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
microsoft/PowerAppsCodeApps#461 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 28/100
microsoft/PowerAppsCodeApps#460 · 3 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in microsoft/PowerAppsCodeApps
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
jbacalso24/mimry#459 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
architecture help wanted hive/claimed-by-architect origin/architect stage/030-pr-in-progress tech-debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
kubestellar/console#24422 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
area: backends type: docs
Schwierigkeit 1/5 1-3 Stunden Anfängerfreundlichkeit 83/100
schlessera/brain-kit#2383 ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent duplicate providers tool triaged
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag