parse-community / parse-community/parse-server

Parse Files saved hardcoded in json in array.

Open
#7,123 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

New Issue Checklist
Issue Description

I have files in json. And I put that json inside of an array. But seems like parse files are saved hardcoded. Even we change fileAdapter, or baseUrl in file adapter, files return with the old url.

Steps to reproduce

Here is an example. This is How I save my files.

    for(var i = 0; i < mediaList.length; i++){
      //...other logic
    
           
      var mainmedia = new Parse.File(user.id, { base64: mediaData },mimeInfo.mime);
      var thumbfile = new Parse.File(user.id, { base64: thumbnail },mimeInfo.mime);
      

      var item = {"type":"image","width":ratiow,"height":ratioh,"media":mainmedia,"thumbnail":thumbfile};
      itemList.push(item);
    
    }
    post.set("media",itemList);

And baseUrl in my adapter is : http://files.example.com

Now file is saved with this url: http://files.example.com/filename

But If change baseUrl to this: http://my-new-file-endpoint.example.com
I still get http://files.example.com/filename but I should get http://my-new-file-endpoint.example.com/filename

Actual Outcome

I get old url
http://files.example.com/filename

Expected Outcome

I should get http://my-new-file-endpoint.example.com/filename

Failing Test Case / Pull Request
  • 🤩 I submitted a PR with a fix and a test case.
  • 🧐 I submitted a PR with a failing test case. (here)
Environment

Server

  • Parse Server version: 4.5 //But got the same result in previous versions too
  • Operating system: Ubuntu 18.04
  • Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc): Remote server

Database

  • System (MongoDB or Postgres): Mongodb
  • Database version: 4.4
  • Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc): remote

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read Parse.File and the fileAdapter/baseUrl handling first, then inspect the failing test in PR #7124. Done means the reproduced array-of-file case returns the updated base URL after the adapter baseUrl changes, with the failing test passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.