Buckets storage randomly uploading files with 0 data

Hello there!
I am having s small problem that I am been unable to solve.

As for YESTERDAY, while using supabase buckets, all images uploads were fine...
Today, when working back into my application, the same images i had used before for testing are now returning empty data.

Nothing was changed regarding the code to affect / cause this behavior.
Also this happens randomly, with random images.

I would appreciate any feedback over this when possible. Below there is the code snippet used (without changes) - remember that this code WAS WORKING YESTERDAY and its NOT TODAY.

  if (files) {
    // username and slug are existing values in code.
    bucket = `${username}/${slug}`;

    await files.forEach(async (file, i) => {
      const imageFilename = `${name}-${i}-${Math.random()}`;
      const imageURL = `${supabaseUrl}/storage/v1/object/public/${stylistBucket}/${imageFilename}`;
      images.push(imageURL);

      const { error: imageUploadError } = await sbAdmin.storage
        .from(stylistBucket)
        .upload(imageFilename, file, {
          cacheControl: "3600", // tried also removing these options but no changes were noticable in this strange behavior
          upsert: false,
          });

      if (imageUploadError) {
        console.error(imageUploadError);
        throw new Error(imageUploadError)
    });
  }
  // everything was working well until yesterday with this same code.
Was this page helpful?