The integrations module needs to detect when a field type changes, and if the old field's service filters don't support the new field type, they must be destroyed.

Relates to Sentry issue 6075172990.

  • Create a link row field
  • Create a data source with a service filter, on that link row field, with the has operator
  • Assign the data source to a collection element
  • Preview the page with the element in it
  • In a separate tab, open the DB table, and convert the link row field to a text field type.
  • Dispatch the datasource, and an exception is raised:
  File "/baserow/backend/src/baserow/contrib/integrations/local_baserow/mixins.py", line 462, in get_queryset
    queryset = super().get_queryset(service, table, dispatch_context, model)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/baserow/backend/src/baserow/contrib/integrations/local_baserow/mixins.py", line 225, in get_queryset
    queryset = self.get_dispatch_filters(service, queryset, model, dispatch_context)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/baserow/backend/src/baserow/contrib/integrations/local_baserow/mixins.py", line 178, in get_dispatch_filters
    view_filter_type.get_filter(
  File "/baserow/backend/src/baserow/contrib/database/views/view_filters.py", line 1246, in get_filter
    remote_model = remote_field.model
                   ^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'model'

The integrations module needs to receive the field_updated signal, detect if the two field types have changed, and then check if any of the old field's filters are incompatible (filter_type.field_is_compatible(field)) with the new field type.