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

addMetadata and addTag do not work with parse-server-fs-adapter #8220

Open
4 tasks done
ma-amin opened this issue Oct 7, 2022 · 3 comments
Open
4 tasks done

addMetadata and addTag do not work with parse-server-fs-adapter #8220

ma-amin opened this issue Oct 7, 2022 · 3 comments
Labels
type:feature New feature or improvement of existing feature

Comments

@ma-amin
Copy link

ma-amin commented Oct 7, 2022

New Issue Checklist

Issue Description

addMetadata and addTag do not work in Cloud Code with Parse FS Adapter.

Steps to reproduce

I used the below code but the createdById and groupName values were not saved

Parse.Cloud.beforeSaveFile(async (req) => {
    const {file, user} = req;
    file.addMetadata('createdById', user.id);
    file.addTag('groupName', groupName);
});

Actual Outcome

The value createdById and groupName were not saved in ParsFile. Actually in ParsFile, metadata and tags are not saved.

Expected Outcome

When file.metadata() and file.tags() are called, the values createdById and groupName should respectively be returned

Environment

Server

  • Parse Server version: 5.2.7
  • Operating system: Ubuntu
  • Local or remote host: etc

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 5.0.10
  • Local or remote host: etc

Logs

None

@parse-github-assistant
Copy link

parse-github-assistant bot commented Oct 7, 2022

Thanks for opening this issue!

  • 🚀 You can help us to fix this issue faster by opening a pull request with a failing test. See our Contribution Guide for how to make a pull request, or read our New Contributor's Guide if this is your first time contributing.

@ma-amin ma-amin changed the title **addMetadata** and **addTag** do not work with parse-server-fs-adapter addMetadata and addTag do not work with parse-server-fs-adapter Oct 7, 2022
@mtrezza mtrezza added the type:bug Impaired feature or lacking behavior that is likely assumed label Oct 7, 2022
@mtrezza
Copy link
Member

mtrezza commented Oct 7, 2022

Not sure whether this is a bug or a feature request, depending on whether Parse FS adapter currently supports the tags feature at all, or whether it has to be implemented for each adapter individually. In any case, I've labelled it as a bug feature for now.

@cbaker6
Copy link
Contributor

cbaker6 commented Oct 9, 2022

Metadata and tags were originally intended for the S3 adapter, see #6341. I believe the Parse Server just forwards these key/values to the respective storage, so other adapters whose storage doesn’t use them (i.e. FS adapter) will discard them. It seems like this feature is requesting to store these in the ParseFile object in the database so you can read them later. If this is the case, I would imagine there would also need to be a way to keep this in sync with the respective info in the storage which may not be straight forward.

@mtrezza mtrezza added type:feature New feature or improvement of existing feature and removed type:bug Impaired feature or lacking behavior that is likely assumed labels Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants