uploadcare / uploadcare-rails

Rails API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
https://uploadcare.com
MIT License
58 stars 70 forks source link

"group_id is invalid" error #133

Closed vipulnsward closed 7 months ago

vipulnsward commented 8 months ago

Describe the bug

When they uploading more then 10 files we get a "group_id is invalid" error.

Works well with 5 files.

After submitting the form, url is being saved in the model


# UploadcareDocument (with mount_uploadcare_file_group :attachments from the gem), and we do that 

uploadcare_document.attachments.load.files.each do |file|
  document = build_content_file(file)
  document = upload_file(document)
  delete_file_from_uploadcare(file)

  document.save!
  self.document = document
end

def build_content_file(file)
  uploadcare_uploaded_file = Uploadcare::FileApi.get_file(file.uuid)
  uploadcare_document.content_files.new(
    uploadcare_uploaded_file: uploadcare_uploaded_file,
    item_attributes: item_attributes(file)
  )
end

Expected behavior

There should be no errors

Code / screenshots

Environment