Parse files saved hardcoded in json?

I save media files in json object. And I add multiple json to an array. That array is a field of parseObject. But when I save object, File url is hardcoded.

This is an example object.

"media": [{
        "type": "image",
        "width": 591,
        "height": 1280,
        "media": {
            "__type": "File",
            "name": "fadee2cc345b9e6e9f03490d2f5f018d_F8Oxm7yQVE.jpeg",
            "url": "This is hardcoded url. And seems like file adapter has no effect on it"
        },
        "thumbnail": {
            "__type": "File",
            "name": "944f9eeb9974d290febcafa0a6dc6400_F8Oxm7yQVE.jpeg",
            "url": "This is hardcoded url. And seems like file adapter has no effect on it"
        }
    }]

Parse files saved the first URL they have got. And When looked the schema ıt just says media field is array but nothing more. Parse schema doesnt show whats inside of array.

How can I solve this? I want to save files like its a filed of parse object. When file is field of the parse Object, Parse only saves file name and fill the url that returned from files adapter? How can I do this?

Where do you see this example of object?

Its my own object in my database. But ıf you ask me what platform I used to see, I’m using mongodb compass.

Here is How I created it:

    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);

I believe it should work properly. I’ve seen the dashboard messing up file fields before. Do you mind to do one more test again? Try to save the file and check the object directly in MongoDB without opening the dashboard.

İ saved many files. And result is same. Also i don’t use dashboard. I’m using MongoDB compass.

And i don’t think it’s related to GUİ tool I’ve used to see objects. Because I change baseUrl in files adapter. But parse files still have old url.

After you changed the baseUrl, if you fetch the object using the API, do you see the old url or the new one?

I see the old url. Seems like parse api don’t change it.

Would you mind to open a PR with a failing test case?

Sorry. I’m a noob. What does “opening a PR with test case” mean? I know how to open a PR. But with failing test case? Do you want me to write a test case in spec.js file ? And create a pull request with that branch?

Any example will be welcome. Sorry if this is a noob question.

Something like this or this or this. There are some other tests related to that. Note there are tests for files in arrays, in objects and also in objects inside objects, but not objects inside arrays.

Oh i understand. But in order to make test fail, base url must be changed. How can we simulate that?

Edit: I created a pull request. But Since I dont know how I can change baseUrl in test file, test case propably will pass. I can push another commit when I learn how to simulate baseUrl change. Or maybe one of the team members push. I allowed members to edit my branch
https://github.com/parse-community/parse-server/pull/7124/

Sorry for the delay. You can do something like this to change the setting.

Sorry. İ didn’t mention here but i did that. Pull request is failing take a look.

Thanks. I will take a look.