[Bug] Changing Select option values does not update existing Flow Models
Describe the bug
Changing the value identifier of options in an existing Select field updates the collection field metadata, but existing Flow Models can continue to store the old option identifiers.
This leaves the application in an inconsistent state:
- Collection field metadata contains the new option values.
- Existing records can be migrated to the new values.
- Some existing UI components still contain copied old options or assigned values.
- A Select field then renders the raw obsolete identifier because it can no longer resolve it to an option label.
- Re-removing and re-adding the field in the Add New form does not necessarily remove old identifiers stored in other Flow Models such as Bulk Edit or Bulk Update.
Environment
- NocoBase: 2.2.12
- Database: PostgreSQL 18.6
- Deployment: Docker
- UI: v2 Flow Model pages
How to reproduce
- Create a string field with the Select interface.
- Add two options using the initially generated identifiers, for example:
1xi9t3b3aen/On salej2l198azs4e/Off sale
- Use this field in an Add New form and in table actions such as Bulk Edit or Bulk Update.
- In the data source manager, change the option identifiers to readable stable values:
on_saleoff_sale
- Migrate existing record values to the new identifiers and set the field default value to
on_sale. - Open the existing Add New form in UI configuration mode.
Actual behavior
The Add New form may display the obsolete raw identifier 1xi9t3b3aen instead of the On sale label.
The collection field metadata and all business records already use the new identifiers, but stale values remain in flow_models.
One stale Select field model contained:
{
"use": "SelectFieldModel",
"props": {
"options": [
{ "label": "On sale", "value": "1xi9t3b3aen", "color": "green" },
{ "label": "Off sale", "value": "j2l198azs4e", "color": "red" }
]
}
}A separate Bulk Update action also retained:
{
"assignedValues": {
"sale_status": "j2l198azs4e"
}
}Deleting and re-adding the field in the Add New form did not repair these separate existing Flow Models.
Expected behavior
When an option identifier is changed, NocoBase should do one of the following:
- Cascade the change to business records and all UI/Flow Model references; or
- Show all affected records and Flow Models and require an explicit migration confirmation; or
- Prevent changing an option identifier after it has been used.
At minimum, obsolete option identifiers should not remain silently in forms, filters, Bulk Edit, Bulk Update, default values, or other Flow Models.
Additional context
This appears related in principle to #5058, where UI filter options were not refreshed after Select options changed, but this report specifically concerns persisted v2 Flow Models and action-assigned values.
The local repair was to update every stale Flow Model reference from the generated values to on_sale / off_sale. After clearing all old identifiers and reloading the page, the Add New form correctly displayed the On sale label.
Source: nocobase/nocobase