Bug: Can't search by strings that begin with a number

Currently, you cannot search by strings that start with a number on Forest.

Expected behavior

When searching for a record with 5 stjernet it should display the record that matches this text.

Actual behavior

  1. Enter 5 stjernet in the search box.
  2. Unexpected error occurs

Failure Logs

“{“errors”:[{“status”:500,“detail”:“operator does not exist: uuid = integer”}]}”

Context

Please provide any relevant information about your setup.

  • Package Version:
  • Express Version:
  • Forest-Express-Sequelize: ^5.7.0
  • Sequelize Version: ^4.37.6
  • Database Dialect: Postgres w/ ssl + encryption
  • Database Version:
  • Project Name: Pento

Hey @imanm,

Thanks for reporting this issue.

It is really weird, I cannot reproduce it on my end.
Did it ever work before?
Do you have more error logs on your admin server?

Thanks.

Hi @imanm,
Can I suggest you to upgrade to the latest forest-express-sequelize version and try again?

Hi,

Thanks for getting back to me. I will give it a go asap.

1 Like

@adriguy Not sure if it ever worked before tbh, as I personally never ran into it. But I will check with my colleagues. I will also look into whether there’s any more useful logs I can provide.

Hi @arnaud,

So i’m just trying to upgrade to the latest version of forest-express-sequelize and I get the following error. Can you help by any chance?

web_1 | /app/forest/node_modules/express/lib/application.js:209
web_1 | throw new TypeError(‘app.use() requires middleware functions’);

It occurs from app.js

app.use(
require(‘forest-express-sequelize’).init({
modelsDir: __dirname + ‘/models’,
envSecret: process.env.FOREST_ENV_SECRET,
authSecret: process.env.FOREST_AUTH_SECRET,
sequelize: require(‘sequelize’),
connections: [models.sequelize.forest_uk, models.sequelize.forest_dk],
integrations: {
stripe: {
apiKey: process.env.STRIPE_SECRET_KEY,
mapping: ‘uk_companies.stripe_id’,
stripe: require(‘stripe’),
},
},
})
)

Hi @imanm,

When upgrading the forest-express-sequelize package version there’s a couple of breaking changes to handle.

Here’s a small guide on how to deal with those: https://docs.forestadmin.com/documentation/how-tos/maintain/upgrade-to-v6

(here you’ll probably have to add an await before the require(‘forest-express-sequelize’).init)

1 Like

@lammat_v ahh I see, thanks for the reference I will do the needful :slight_smile:

2 Likes