New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MLIBZ-2498: Kinvey.Files.upload() returns an error if the submitted metadata = null #334

merged 1 commit into from Jul 25, 2018


None yet
2 participants

thomasconner commented Jul 23, 2018


Tested with 3.10.3 in the HTML5 shim. The tests for upload in test/integration/tests/files-common.tests.js in QA-196_tests_files branch can be accommodated in order to reproduce the issue.

Steps To Reproduce:

  1. Try to upload a file with:
Kinvey.Files.upload(file, null, { timeout: 100000 })

Expected Result: The operation succeeds
Actual Result: The following error:

TypeError: Cannot read property 'filename' of null
      at FileStore.transformMetadata (http://localhost:64320/packages/kinvey-html5-sdk/dist/kinvey-html5-sdk.js:33946:41)
      at FileStore.upload (http://localhost:64320/packages/kinvey-html5-sdk/dist/kinvey-html5-sdk.js:33894:23)
      at Object.testFileUpload (http://localhost:64320/test/integration/tests/utilities.js:252:18)
      at (http://localhost:64320/test/integration/tests/files-common.tests.js:349:19)
      at (http://localhost:64320/node_modules/kinvey-universal-runner/injectables/bundles/testRunner.bundle.js:9439:29)
      at Runner.runTest (http://localhost:64320/node_modules/kinvey-universal-runner/injectables/bundles/testRunner.bundle.js:9854:22)
      at http://localhost:64320/node_modules/kinvey-universal-runner/injectables/bundles/testRunner.bundle.js:9900:26
      at next (http://localhost:64320/node_modules/kinvey-universal-runner/injectables/bundles/testRunner.bundle.js:9780:28)
      at http://localhost:64320/node_modules/kinvey-universal-runner/injectables/bundles/testRunner.bundle.js:9789:21
      at next (http://localhost:64320/node_modules/kinvey-universal-runner/injectables/bundles/testRunner.bundle.js:9733:35)


  • Use Object.assign() to create metadata.

@thomasconner thomasconner self-assigned this Jul 23, 2018

@thomasconner thomasconner requested a review from vinaygahlawat Jul 23, 2018


LGTM - but one quick question: will existing tests cover this case?

@thomasconner thomasconner merged commit 3a858a5 into master Jul 25, 2018

1 of 2 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
continuous-integration/travis-ci/push The Travis CI build passed

@thomasconner thomasconner deleted the MLIBZ-2498_Fix_Invalid_File_Metadata branch Jul 25, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment