Skip to content

Typo in new FileUpload options #7602

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

Closed
Vortec4800 opened this issue Oct 2, 2021 · 10 comments
Closed

Typo in new FileUpload options #7602

Vortec4800 opened this issue Oct 2, 2021 · 10 comments
Labels
type:docs Only change in the docs or README

Comments

@Vortec4800
Copy link
Contributor

This issue is for the latest release of Parse Server, 4.10.4, regarding #7071.

In all the documentation everywhere, and in the sample config, the new options are listed as:

fileUpload: {
  enabled: true, // Is true if files can be uploaded with Parse Server. Default is true.
  enabledForAnonymousUser: false, // Is true if file upload is enabled for Anonymous Users. Default is false.
  enabledForPublic: false // If true if file upload is enabled for anyone with access to the Parse Server file upload endpoint, regardless of user authentication. Default is false.
}

I set these keys in my config but still couldn't get it to work. Finally after digging for a while, I realized in the actual FilesRouter.js where the config options are checked, it's listed as:

if (!isMaster && !config.fileUpload.enableForPublic && !user) {
  next(new _node.default.Error(_node.default.Error.FILE_SAVE_ERROR, 'File upload by public is disabled.'));
  return;
}

Note this shows enableForPublic instead of enabledForPublic as above.

I don't know if this is a documentation bug or a bug in the Router, but I wanted to highlight this in case someone else was trying to get it working.

@parse-github-assistant
Copy link

Thanks for opening this issue!

  • ❌ Please edit your post and use the provided template when creating a new issue. This helps everyone to understand your post better and asks for essential information to quicker review the issue.

@dblythy
Copy link
Member

dblythy commented Oct 2, 2021

Nice catch! Would you be willing to submit a PR?

@Vortec4800
Copy link
Contributor Author

Sure thing... Just need to know which one is correct 😁

@dblythy
Copy link
Member

dblythy commented Oct 2, 2021

If it’s consistently enableForPublic in this repo, then there’s no point in my opinion to change it (as it would be a breaking change for configurations that are already using the correct option.

I think updating the documentation is the easiest approach. What do you think?

@dblythy
Copy link
Member

dblythy commented Oct 2, 2021

Could you point to the documentation that is outdated?

The fileUpload feature is an unreleased feature, not available on 4.10.4. It will be available on V5, or, is currently available on the master branch.

https://github.com/parse-community/parse-server/blob/master/CHANGELOG.md

@Vortec4800
Copy link
Contributor Author

I see that now in the changelog. This is my mistake, most of my projects specify the latest version but for some reason, this one had the full repo URL instead of a version so it grabbed master. I was thinking this was version 4.10.4 but you are correct, this project was on master by mistake. Might have been filled in "helpfully" by WebStorm or something.

Well, we should probably leave this issue open for the time being because the bug still exists - just not in production. Given it hasn't been released yet, probably easiest just to update the Router to match the spec/doc/etc. I can send in this PR if that sounds like a plan.

@dblythy
Copy link
Member

dblythy commented Oct 2, 2021

Well, we should probably leave this issue open for the time being because the bug still exists

Could you point me to where in the project/documentation the "enabledForPublic" code is? I can only find it in outdated PRs that weren't merged, such as this comment and #6997.

The merged spec seems to consistently use enableForPublic.

@Vortec4800
Copy link
Contributor Author

Yes you're right, I was looking at the outdated PR #6997 and grabbed the options from there. I thought it was weird that I couldn't find good documentation elsewhere, I guess it's been a long week...

@dblythy dblythy added the type:question Support or code-level question label Oct 2, 2021
@dblythy
Copy link
Member

dblythy commented Oct 2, 2021

No worries at all! We'll add the full fileUpload documentation to the docs once V5 is released.

@Vortec4800
Copy link
Contributor Author

Makes sense. Thank you!

@mtrezza mtrezza added type:docs Only change in the docs or README and removed type:question Support or code-level question labels Mar 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:docs Only change in the docs or README
Projects
None yet
Development

No branches or pull requests

3 participants