Not able to update a jsonb field to null

Expected behavior

When I empty the input of a jsonb field, I want it to set to null.
The field is nullable in both forest conf and in DB.

Actual behavior

The field reverts to the previous value once I hit save. I get the success message telling that the entry has been saved.

The CREATE works well when I leave the input blank : the field will be set to null.
Error is only occuring on an UPDATE for me when the field has been set to some value and then I want to set it back to null.

Also I can update the field to any other value and it will work, I just cannot set it to null.

Failure Logs

When looking at the logs, I would be expecting and UPDATE statement, but I only get SELECT.
But no error.

Context

Please provide any relevant information about your setup.

  • Package Version: forest-express-sequelize@8.0.7
  • Express Version: 4.17.1
  • Sequelize Version: 5.15.2
  • Database Dialect: node-postgres
  • Database Version: 8.5.1
  • Project Name: Greenly-Corporate

Hello @lucas-greenly,

Thanks for your message and welcome to our community! :raised_hands:

I just tried out your use case myself and indeed, it is just impossible to set null to the JSON value.
I am creating a bug report as of now and I’ll let you know when it is fixed.

Thanks for your report!
We’ll do our best to solve this asap.

Cheers.

Hi @adriguy ,

This is good news !
Thank you very much for looking into it :slight_smile:

Cheers

Hey @lucas-greenly,

We finally release a patch to fix this issue.
Can you confirm it is now working on your side?

Thanks a lot.
Cheers!

1 Like

Hi Adrien,

It works ! Thank you very much :slight_smile:

Cheers

1 Like