Skip to content
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

Don't send tags object to Parse file adapter when no tags are set #7129

Closed
4 tasks done
sarsonj opened this issue Jan 18, 2021 · 8 comments
Closed
4 tasks done

Don't send tags object to Parse file adapter when no tags are set #7129

sarsonj opened this issue Jan 18, 2021 · 8 comments
Labels
type:bug Impaired feature or lacking behavior that is likely assumed

Comments

@sarsonj
Copy link

sarsonj commented Jan 18, 2021

New Issue Checklist

Issue Description

We are using Digital Ocean Spaces for storing files. It is S3 compatible storage, so that we are using parse-server-s3-adapter. However, DO Spaces don't support all S3 features - one of unsupported are tags. In current version of parse-server-s3-adapter every upload fails. The problem is, that ParseFile contains tags object even when no tags are set.

Firstly, I proposed change in parse-server-s3-adapter adapter itself (see pull request parse-community/parse-server-s3-adapter#135), but after some discussion was raised question, if this should not be handled in ParseFile itself. I looked to code and by default ParseFile sets both metadata and tags to empty objects. In this case, s3 files adapter send those options to S3 as empty tags list.

Is there any reason why both tags and metadata are always empty objects and not undefined when not set? Maybe this is architectural decision, but files adapters handles case, when tags and metadata are undefined and in that case, they correctly don't set them.

Steps to reproduce

  1. configure Parse server with Digital ocean spaces as file storage
  2. try to upload - it fails
  3. try to remove code, that sets metadata in Parse File S3 adapter
  4. upload works

Actual Outcome

Current verson of Parse server don't work with Digital Ocean spaces

Expected Outcome

It should work with Digital Ocean Spaces

Server

  • Parse Server version: 4.5.0
  • Operating system: docker nodejs
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Digital Ocean

Database

  • System (MongoDB or Postgres): Postgres

Client

  • SDK (iOS, Android, JavaScript, PHP, Unity, etc): CloudCode
@mtrezza
Copy link
Member

mtrezza commented Jan 18, 2021

Thanks for reporting.

Can you please write a test case where the tags in Parse.File are not set but an empty tag object is created instead of undefined?

@mtrezza mtrezza added type:bug Impaired feature or lacking behavior that is likely assumed S4 labels Jan 19, 2021
@mtrezza
Copy link
Member

mtrezza commented Jan 19, 2021

I have classified this as a bug with severity 4:

  • Workaround: fork parse server s3 adapter and remove the tags parameter
  • Fix: change to not send the tag parameter if it is not set

@sarsonj
Copy link
Author

sarsonj commented Jan 20, 2021

@mtrezza I will prepare test and look on fix as well.

@alioguzhan
Copy link
Contributor

This is also a blocker for Linode Object Storage. I was able to make it work by downgrading the parse-server-s3-adapter to v1.4.0

@mtrezza
Copy link
Member

mtrezza commented Mar 27, 2021

Thanks for confirming, @alioguzhan. Would you want to make a PR to fix this?

@alioguzhan
Copy link
Contributor

Sure @mtrezza . If you provide me a little guidance by pointing the starting point, I can make a PR. AFAIK, this is occurring because the parse-server sends tags to the provider no matter what, even if it is not set.

@mtrezza
Copy link
Member

mtrezza commented Mar 27, 2021

That's correct. I suggest to read the original discussion that lead to the opening of this issue.

The general approach would be to only set the tags property of a Parse.File, if the tags are actually set. Let me know if you need more details, and I can take a closer look at the code.

@mtrezza
Copy link
Member

mtrezza commented Apr 2, 2021

This should be fixed by #7300

@mtrezza mtrezza closed this as completed Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Impaired feature or lacking behavior that is likely assumed
Projects
None yet
Development

No branches or pull requests

3 participants