Hacktoberfest 2026 : les issues que les mainteneurs ont marquées pour octobre, ouvertes et accessibles aux débutants. Parcourir les issues Hacktoberfest

[Bug] Generated Dataverse delete() discards IOperationResult, so failed deletes are silent

Ouverte
#469 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

@ergonza93 y travaille déjà.

Depuis le 1/10/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

bug

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

  1. 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).
  2. Add both tables with pa app add data-source --connector dataverse --table <name>.
  3. Create a parent row and a child row that references it.
  4. Call Contoso_projectsService.delete(parentId) from the app.
  5. 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-apps 1.2.12 (also type-checked against 1.5.0), @microsoft/power-apps-cli 0.15.2 (also inspected 1.2.0), @microsoft/power-apps-vite 1.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: delete is still Promise<void> and deleteRecordAsync is still typed Promise<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 delete and call getClient(dataSourcesInfo).deleteRecordAsync(tableName, id) directly, throwing when result.success is false. Editing the generated file is not viable because it is overwritten on the next refresh.
  • Suggested fix: change the delete template in both the standard and partitionId variants to return the result, e.g. Promise<IOperationResult<void>> and return result;, matching update.
Langage dominant
TypeScript
Étoiles
513
Forks
143
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de microsoft/PowerAppsCodeApps

Toutes les issues de microsoft/PowerAppsCodeApps

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.