Array smart fields referencing dynamic collections are no longer sent

Hi there :wave:, we detected some regression on smart fields arrays referencing dynamic collections. This regression seem pretty recent as this was working last Friday (2022/10/28). Please find some more info in the following sections.

Feature(s) impacted

Smart fields with string array type referencing dynamic collections

Observed behavior

It seems like smart fields of type ['String'] are no longer sent in the creation or update payload attributes when using checkboxes or a dropdown referencing a dynamic collection (this feature was working on Friday, Oct. 28, 2022).

Minimal reproduction steps:

  • Setup minimal collection with a smart field of type [β€˜String’]:
// forest/minimal.js
const { collection } = require('forest-express-sequelize');
collection('minimal', {
  fields: [
    {
      field: 'smartField',
      type: ['String'],
      get: (record) => console.log('smartField.get', record),
      set: (record, fieldValue) => console.log('smartField.set', record, fieldValue),
    },
  ],
});
// models/minimal.js
module.exports = (sequelize, DataTypes) => {
  const { Sequelize } = sequelize;
  const Minimal = sequelize.define(
    'minimal',
    {
      id: {
        type: DataTypes.UUID,
        primaryKey: true,
        defaultValue: Sequelize.literal('uuid_generate_v4()'),
      },
    },
    {
      tableName: 'minimal',
      schema: config.db.schema,
      createdAt: false,
      updatedAt: false,
    },
  );

  return Minimal;
};

This change might be related to the recent patch following this issue: Smart action field hook not triggering for array type

Expected behavior

The expected behavior is to received the selected fields in the attributes property of the payload like described in the documentation and as it was previously the case.

Context

  • Project name: folk
  • Team name: Folk
  • Environment name: All environments
  • Agent type & version: forest-express-sequelize@8.5.0

Hi @dramloc :wave: welcome to our community.
Unfortunately we are aware of this issue. We already reverted the contribution who cause the issue, can you try again and let me know if that work ? :pray:

1 Like

This fixed the issue!
Thank you very much for your quick response :pray:

1 Like