question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

setFileMeta not passing params after upgrade

See original GitHub issue

The code works in our app using the following:

"@uppy/aws-s3": "1.5.2",
"@uppy/core": "1.8.2",
"@uppy/dashboard": "1.6.2",
"@uppy/drag-drop": "1.4.5",
"@uppy/react": "1.4.5",
"@uppy/status-bar": "1.5.2",

Application Code:

const uppy = Uppy({
    debug: false,
  })
    .use(UppyDashboard, {
      trigger: `.upload-item-${taskListItem.id}-files`,
      showProgressDetails: true,
    })
    .use(AwsS3, {
      getUploadParameters(file){
        const attachment = {
          attachable_id: taskListItem.id,
          attachable_type: 'TaskListItem',
          attachment_type: 'deliverable-change',
          content_type: file.type,
          file_name: file.name,
        }

        const requestOptions = {
          presign_url_only: true,
        }

        return createAttachment(attachment, requestOptions).then((result) => {
          const { data, id } = result
          const { presigned_url } = data || {}

          // Store the attachment ID in meta data so we can update later
          uppy.setFileMeta(file.id, { attachmentId: id })

          return {
            method: 'PUT',
            url: presigned_url,
            fields: [],
          }
        })
      },
    })
   .on('upload-success', (file) => {
      const {
        meta: { attachmentId },
        name,
        size,
        type,
      } = file

      if (attachmentId){
        const updated = {
          id: attachmentId,
          file_file_name: name,
          file_content_type: type,
          file_file_size: size,
        }

        updateAttachment(updated, { include_attachment_file: true })
      }
    })

When we upgrade to:

"@uppy/aws-s3": "^1.6.2",
"@uppy/core": "^1.10.2",
"@uppy/dashboard": "^1.8.3",
"@uppy/drag-drop": "^1.4.10",
"@uppy/react": "^1.6.3",
"@uppy/status-bar": "^1.6.3",

The file meta data (attachmentId) is no longer present.

We couldn’t find anything in the docs that mentioned a change in how this works.

Thanks in advance for your assistance!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
goto-bus-stopcommented, May 18, 2020
0reactions
goto-bus-stopcommented, Jun 24, 2020

Released in @uppy/aws-s3 v1.6.5. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to pass meta data using Uppy's Dashboard plugin
First of all need to change file.meta.id to file.id uppy.on('file-added', (file) =>{ console.log(file); uppy.setFileMeta(file.id, { test: ...
Read more >
const - Uppy
This means several calls to .upload() , or a user adding more files after ... Note: no notification will be shown to the...
Read more >
Custom meta data not returned in notify_url request despite ...
Hey guys; Even though I call setFileMeta when a file gets added ... via the “notify_url” parameter) does not include my custom meta...
Read more >
Merge DICOM ToolkitTM V. 5.11.0 - IBM
This User's Manual is intended for developers of medical imaging applications who are using the Merge DICOM Toolkit to provide DICOM network or...
Read more >
uppy - UNPKG
readyState) return;\n debug('changing transport and sending upgrade ... because there could be other\n // arguments passed either before or after the %c, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found