The objectParam property is copied over to the S3 params object which is handed off to the Uploader (s3-streaming-upload). The problem is that the Uploader appends some other data to the params, such as the Key of the file, and the data spills over to the awsConfig object on DynamoBackup. This happens because Object.assign on line 48 performs a shallow copy, and the original objectParams object is changed.
The symptom is that if you backup several tables simultaneously, they will all share the same Key property, and only 1 .json file will be saved in the bucket.
@miguelduarte42 Thank you for your contribution and sorry for delay to merging this, somehow I missed notification.
Will publish to npm in few minutes.
This fixes a bug which reveals itself when you use the
objectParams
property. Example:The
objectParam
property is copied over to the S3 params object which is handed off to the Uploader (s3-streaming-upload). The problem is that the Uploader appends some other data to the params, such as theKey
of the file, and the data spills over to theawsConfig
object onDynamoBackup
. This happens becauseObject.assign
on line 48 performs a shallow copy, and the originalobjectParams
object is changed.The symptom is that if you backup several tables simultaneously, they will all share the same
Key
property, and only 1 .json file will be saved in the bucket.The solution was to perform a deep copy of the object using JSON.stringify and JSON.parse
I also included documentation on how to use the objectParams property.