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

File on files.parse.com (instead of files.parsetfss.com) do not load. #1521

Closed
barnaclejive opened this issue Apr 17, 2016 · 2 comments · Fixed by #2001
Closed

File on files.parse.com (instead of files.parsetfss.com) do not load. #1521

barnaclejive opened this issue Apr 17, 2016 · 2 comments · Fixed by #2001
Assignees

Comments

@barnaclejive
Copy link

Images hosted on files.parse.com are assumed to be "new since migration" and thus the parse-server generates a url pointing at my parse-server instead of parse.com's S3 url. These are older images, I assume before parse.com switched to the files.parsetfss.com server.

Newer images (though before migration) point to files.parsetfss.com and load OK.

Newer images (after migration) point to my server and load OK.

Example:

parse.com URL: (created a long time ago on parse.com)
http://files.parse.com/9e30bab0-73bc-44a6-b468-9e105179430a/db70e289-a9ef-4e0d-ab34-f096c424de41-image_main.jpg

parse-server URL: (does not actually exist on my S3, this file existed before migration)
http://petfetch-server.herokuapp.com/parse/files/petfetch_appid_debug/db70e289-a9ef-4e0d-ab34-f096c424de41-image_main.jp

parse.com and parser-server both generate the correct URL for this image:
https://files.parsetfss.com/9e30bab0-73bc-44a6-b468-9e105179430a/tfss-95a01ef5-b669-4221-8afe-18384bef442f-image_main.jpg

Environment Setup

Merged master 4/16/16

Steps to reproduce

Logs/Trace

@barnaclejive
Copy link
Author

barnaclejive commented Apr 17, 2016

There is another report of this mentioned in #8 reported by @trondwernerhansen

Seems to be a problem in FilesController.js when Parse Server checks wether to use parsetfss.com or adapter for a file:
if (filename.indexOf('tfss-') === 0) {..
I have old files on Parse that do not begin with 'tfss-', and they are wrongly sent to adapter.
Looks like Parse Server does:
filename = randomHexString(32) + '_' + filename;
on any new files, so I guess a fix would be to check for that underscore, since it would never match old files.

@drew-gross
Copy link
Contributor

cc @skinp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants