Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Bug] Power Apps Android app: binary data between a code app and the host breaks — Dataverse image upload fails ("o.arrayBuffer is not a function"), picked files can't be read (FileReader {"code":2}), downloaded images render gray / truncated

オープン
#503 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
48/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
databases, react, typescript, vite

調査の方向性

Start by tracing the generated service methods uploadFileToRecord, downloadImageFromRecord, and downloadFileFromRecord in the repository; the issue does not name their source files or tests. Compare how they handle binary data in the Android host and browser, then reproduce the upload, picked file read, and image download failures in the Power Apps Android app. Done means standard file APIs and the service methods work with complete image bytes on Android as they do in the browser.

索引モデルが issue の本文から書いたものです。

説明

bug

Describe the bug

In the Power Apps Android app, a published code app can't reliably exchange binary data with the host, while the same app works fine in the browser (Edge / Chrome on desktop, apps.powerapps.com/play/...):

  1. Upload of an image to a Dataverse image column with the generated service (<Table>Service.upload(id, '<imagecolumn>', file) → uploadFileToRecord) fails with o.arrayBuffer is not a function.
  2. Reading a picked file (<input type="file" accept="image/*">, the file arrives as resized-<guid>.jpg) with FileReader fails with an error object that only contains {"code":2} — both right after picking and later. {"code":2} looks like the SECURITY_ERR of a Cordova-style FileError, not a browser DOMException.
  3. Download of an image with the generated service (<Table>Service.downloadImage(id, '<imagecolumn>', true) → downloadImageFromRecord) returns data that renders as a gray image with only the top rows of the photo (a truncated / corrupted JPEG). The image stored in Dataverse is complete (verified via the Web API: x-ms-file-size = the uploaded size, the full image opens correctly in the browser version of the same app).

The browser version of the same app (same environment, same records) uploads, reads and shows the images correctly.

Steps to Reproduce

  1. Create a code app (@microsoft/power-apps 1.5.0, pa CLI) with a Dataverse table that has an image column (full image stored: CanStoreFullImage = true) as a data source.
  2. Add an <input type="file" accept="image/*">; on change, upload the file with the generated service: await <Table>Service.upload(recordId, '<imagecolumn>', file).
  3. Show an image with await <Table>Service.downloadImage(recordId, '<imagecolumn>', true) → data: URL (blob: URLs are blocked by the CSP) → <img>.
  4. Push the app, open it in the Power Apps Android app (Play Store), pick a photo from the device and upload it; open a record with an image.

Expected behavior

  • <Table>Service.upload(...) with a picked File works in the Android app as it does in the browser.
  • A picked file can be read with the standard web APIs (FileReader, Blob.arrayBuffer()).
  • <Table>Service.downloadImage(...) returns the complete image bytes (a Uint8Array), as in the browser.

Actual behavior

What Browser Power Apps Android app
Service.upload(id, column, file) works fails: o.arrayBuffer is not a function
FileReader.readAsDataURL(file) on the picked file works fails: error object {"code":2} (also right after picking)
Service.downloadImage(id, column, true) → data: URL correct image gray image, only the top rows visible (corrupted / truncated bytes)
Image stored in Dataverse after a browser upload complete complete (same record)

What we tried (in order)

# Approach Result in the Android app
1 <Table>Service.upload(id, column, file) (binary upload via the SDK) ❌ o.arrayBuffer is not a function
2 Read the file at save time with FileReader → base64 → save in the record (create with "<imagecolumn>": "<base64>") ❌ FileReader error {"code":2}
3 Same, but read the file immediately after picking ❌ {"code":2} right after picking
4 Current workaround (works): try every way to get the bytes in turn — file.arrayBuffer(), new Response(file).arrayBuffer(), fetch(URL.createObjectURL(file)), a FileReader taken from a fresh same-origin about:blank iframe, window.FileReader — then re-encode (canvas → JPEG), convert the bytes to base64 without FileReader, and save the image as base64 in the record's create payload ("<imagecolumn>": "<base64>") ✅ upload works; full image stored (verified via the Web API)
5 Download: downloadImage(id, column, true); accept every data shape (Uint8Array, ArrayBuffer, number array, base64 / binary string), check the JPEG end marker, fall back to the thumbnail from the query ❌ still gray: the bytes pass the checks but are corrupted

Notes:

  • Creating records also showed "An unknown error occurred" in the Android app while Dataverse did save the row (the create reads the record back; related: #444). Workaround: set the primary key in the app and check with a list query after an error.
  • The host rejected one call with a plain object (shown as [object Object]), not an Error.

Questions for the team

Our workaround (4) works, but it bypasses the SDK's upload and depends on how the Android app exposes picked files. We would prefer the standard approaches to work in the Android app as they do in the browser:

  1. Can <Table>Service.upload / uploadFileToRecord accept a picked File in the Android app (the host seems to call arrayBuffer() on an object that doesn't have it)?
  2. Can a file picked in a code app be read with the standard FileReader / Blob.arrayBuffer() in the Android app? Is window.FileReader / File replaced inside the code app's frame (the {"code":2} error looks like Cordova's FileError.SECURITY_ERR)?
  3. Can <Table>Service.downloadImage (and downloadFileFromRecord) return the complete binary data in the Android app? It looks like the bytes are converted to text on the way (the JPEG header survives, the rest doesn't).
  4. Is there a recommended way to upload / download images and files from a code app on mobile until this is fixed?

Screenshots or Error Messages

  • New record form, Android app: o.arrayBuffer is not a function (screenshot 1)
Image
  • Detail view, Android app: the image renders gray, only the top rows visible; same in the enlarged view (screenshots 2, 3)
  • The image could not be read: {"code":2} (FileReader on the picked file)
Image Image

Environment information

  • Framework, build tool or relevant package used: React 19, Vite 7, TypeScript 5.9, @microsoft/power-apps 1.5.0, @microsoft/power-apps-vite 1.0.2, pa CLI 1.3.0
  • Any connection/components: Dataverse (native data source, generated services), image column with full image stored; Office 365 Outlook / Users connectors (not involved)
  • Device: Android phone, Power Apps app from the Play Store (version: 3.26094.5 ), Android version 16
  • Browser comparison: Edge / Chrome on Windows — everything works

Additional context

  • The app is pushed with pa app push and shipped in a solution; the same behaviour in both.
  • Related Android issues: #444 (single-record reads hang / fail in the Android app), #364 (100vh on Android).
主要言語
TypeScript
スター
516
フォーク
145
平均マージ
1日 10時間
マージ済み PR(30日)
23

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/PowerAppsCodeApps のほかの issue

microsoft/PowerAppsCodeApps の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。