ForestAdmin / forest-express

🧱 Dependency of Express Lianas for Forest Admin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serializer fail since 1.5.1

GautierT opened this issue · comments

Since this commit : 20f1ad5 the require('forest-express').ResourceSerializer is not working correctly.

On a relationship route i fetch some data then i pass it to Serializer like that :

 const serialized = await new Serializer(Liana, Letters, results.docs, null, {}, {
        count: results.total
      }).perform()

But i now have an error related to aws-sdk (probably when trying to get signed url from aws to display it on forest)
MissingRequiredParameter: Missing required key 'Key' in params

"Fixed" with npm i forest-express-mongoose@1.5.0

Hey @GautierT, it is not really clear to me what your issue is.
It looks like it has been fixed with the liana upgrade. Does it work as expected right now?

After updating from 1.5.0 to 1.5.2 (or 1.5.1), require('forest-express').ResourceSerializer is broken.
So i have to stay on 1.5.0 to make it work.
Which Liana upgrade are you talking about ? On npm the latest is 1.5.2.

@GautierT did you implement some Smart Fields on the Letters collection?
You're talking about AWS, I wonder if you do have a Smart Field that compute something using the aws-sdk ?

The thing is that we now inject Smart Field values in the record(s) before serialization.
So if you have some Smart Fields on this collection, it might be an issue in your Smart Fields getter methods.

I imagine that if you comment it out, the issue disappear right?

@GautierT any news about your issue?

Hi.
Yes, if i comment the smart fields who get a signed url from aws then the issue disappear.

Found the solution : the sub document containing the file was not populated so the necessary data for get the signed url was missing.