rowy icon indicating copy to clipboard operation
rowy copied to clipboard

Derived Column: storage cannot upload stream/file

Open abegehr opened this issue 1 year ago • 0 comments

Describe the bug The storage instance of firebasestorage.Storage doesn't have any options to upload a file to firebase storage from a readable stream. Checking the @google-cloud/storage docs, it should be there - which version of firebase-admin/storage or @google-cloud/storage should I use as reference?

To Reproduce Steps to reproduce the behavior:

  1. Go to a derived column function code
  2. Write storage.bucket().file(samplefile.txt).createWriteStream(); in the derivative function.
  3. See error

Expected behavior I'd expect storage to be able to upload a file from a stream.

Screenshots Screenshot 2024-10-31 at 18 21 24

      const ts = Date.now();
      const filePath = `users/${row.user.id}/uploads/${ts}-${i}.jpg`
      const fileRef = storage.bucket().file(filePath);
      const outputStream = fileRef.createWriteStream();

Rowy Run version If applicable, share the Rowy Run version from your project settings.

Desktop (please complete the following information):

  • OS: macOS 15.0.1
  • Browser Chrome
  • Version 130.0.6723.71

Smartphone (please complete the following information): nA

Additional context Links to documentation/references:

  • @google-cloud/storage how to streaming upload: https://cloud.google.com/storage/docs/streaming-uploads
  • @google-cloud/storage File.createWriteStream ref: https://googleapis.dev/nodejs/storage/latest/File.html#createWriteStream
  • Rowy storage interface: https://github.com/rowyio/rowy/blob/main/src/components/CodeEditor/firebaseStorage.d.ts#L429

abegehr avatar Oct 31 '24 14:10 abegehr