* fix(database): run realtime refresh callbacks when no view is selected
Fixes#6943
* fix(database): add created and restored fields when no view is selected
view/getSelected is {} without a selected view, so the field_created and
field_restored handlers looked up an undefined view type and threw. Use
view/hasSelected instead, and cover both events on a table page without views.
* fix: keep public and restricted views in sync when linked-table changes move rows (#6339)
- Dependency cascades now send rows_deleted / rows_created to publicly shared
and restricted views when a row leaves or enters their filters. The decision
is made inside the transaction, from a before snapshot read under the row lock.
- Only tables with such a view filtering on a field the cascade changes pay for
this. The check is an EXISTS inside the existing snapshot read, so other tables
run the same queries as before and take no extra lock.
- Snapshot reads match ids read from the link tables with id = ANY(ARRAY(...)),
which avoids a full primary key walk. A row the cascade updated before
snapshotting it never gets an enter/leave decision.
- Fields a cascade changes without an UPDATE (link values) are tracked across
the transaction. Views filtering on them are skipped, and those values are
left out of rows_deleted. This replaces the cell_values_come_from_other_tables
field type flag.
- Cascades over the realtime limit also refresh publicly shared and restricted
views (force_view_rows_refresh), not only workspace members.
- On realtime deletes, the client removes rows it already holds by id. When the
payload lacks a value it needs to place an unheld row, it leaves counts as
they are.
- Creating a linked row from a link cell no longer sends a redundant PATCH,
which failed in restricted views.
* test: keep only the essential #6339 tests and trim docstrings
Merge overlapping tests into shared builders and parametrized cases. Keep one
test per behaviour, and keep the exact security assertions. Cut new docstrings
and comments down to the non-obvious why.
* fix: keep a link created from the link-cell modal in the cell (#6339)
Skipping the redundant PATCH also skipped the only local write of the
new link, so a later pick or remove PATCHed a stale list and unlinked
the created row. The link is now applied locally through the same store
path realtime uses; only the PATCH is skipped.
* fix: let a cascade decide only rows nothing else wrote in the transaction (#6339)
A broadcast decided enter and leave from its first snapshot of a row
and cached the result, so another write in the same transaction made
it send rows or values a public or restricted view never showed: a
direct edit after the cascade, a row created or edited before it, the
other rows after close() split the broadcast, or a cascade inside a
savepoint.
The transaction's writes are now tracked per table. At commit, a
broadcast drops every row something else wrote: rows written directly
keep develop's direct-path events, and rows of a savepoint split or of
a bulk write get none. close() is gone.
Also pins the no-lock gate's filters_disabled and changed-link cases.
* chore: shorten the #6339 changelog entry
* fix(database): open new-tab URL buttons in Safari
Safari blocks window.open once the dispatch request has returned, so the
button opens the tab on click and the Open URL action navigates it.
* fix(database): take opens_new_tab from the field after saving actions
The action list is stale when refreshing it fails.
* test(database): match button flags by label, not list order
* fix(database): leave no empty tab for mailto and tel button URLs
Such URLs hand off to another app, so they navigate the current page and
the placeholder tab is closed. Covers opens_new_tab in the broadcast test.
* feat: retire AI provider flag and add rollout audit
* test: remove obsolete AI provider flag setup and docs
* chore: clean up AI provider configuration and tests
* feat: deprecate legacy AI provider environment configuration
* docs: explain AI provider migration sizing and timing
* docs: mark AI provider migration audit for removal
* docs: explain AI provider migration audit usage
* fix: log AI provider env deprecations after logging setup
log_ai_provider_env_deprecations() ran at the tail of _setup_health_checks(),
which ready() calls before setup_logging(). The notice went out through
loguru's default sink and missed BASEROW_BACKEND_LOG_LEVEL, the Baserow
format, and the OpenTelemetry log exporter, so operators shipping logs to a
collector never saw it.
Also drop two references the flag removal invalidated: the getEffectiveAIAgentModels
JSDoc still described filtering as conditional on the removed provider flag, and
the AI field architecture doc still pointed provider authors at the deleted
legacy workspace-setting hook. That doc now names BuiltInGenerativeAIModelType,
which is what grants an integration override model inheritance.
* fix: reuse environment AI settings in generation workers
* feat: import legacy AI provider settings on upgrade
Removing the ai-providers flag makes database-backed providers the default, which
would leave every existing installation on an empty AI providers page with a
management command as the only way to populate it. A data migration imports the
environment and each workspace's stored settings instead, so a standard upgrade
needs no commands.
Both scopes are imported in one migration. Legacy workspace settings replaced the
instance ones entirely, while database providers inherit, so each imported workspace
is also switched off the instance provider of the same type. Without that a workspace
would silently gain models billed to the instance account.
Settings that cannot fit their columns are skipped and logged rather than raising
DataError and rolling back the whole upgrade. The migration reverses as a no-op
because the previous version does not read these tables, so deleting rows would only
discard edits made during a rollback window.
migrate_ai_provider_settings stays as the recovery path and now shares its planning
logic with the migration, so both agree on which legacy settings are complete. It
deliberately does not switch workspaces off inherited providers, and warns instead.
* chore: remove the temporary AI provider audit command
audit_ai_provider_settings existed to inventory legacy configuration before a manual
import. The upgrade now imports automatically, so the command has no remaining step
to support. Removal was already tracked in #5749.
* docs: reduce AI provider docs to lasting behaviour
The upgrade procedure, rehearsal plan and sizing query described a one-time
transition and do not help anyone after the release; they live in the pull request
instead. What remains explains how providers work: the two scopes, how they combine,
the inheritance switch, what the deprecated environment variables still do, and how
integration overrides and published applications behave.
Also corrects claims that no longer hold: published applications keep materialised
credentials only when they were published before the upgrade, the import is no longer
optional, and a workspace-owned provider suppresses the environment fallback too.
* docs: shorten the AI provider changelog entries
Bullet points render as single list items under the entry. The released entries
average around twenty characters; these ran to four hundred, so the detail belongs
in the AI providers guide rather than the changelog.
* docs: clarify where imported AI credentials are stored
The previous wording implied Baserow's own exports carry provider credentials.
They do not: AIIntegrationType lists ai_settings as a sensitive field and
ImportExportConfig excludes those by default, and AIProviderConfig is not part of
any export path.
* docs: explain the AI provider upgrade and where to configure providers
State that the upgrade imports the BASEROW_* provider variables once and no longer
reads them, list the exceptions, and give the exact navigation for instance admins
(Admin tools -> AI providers) and workspace admins (workspace Settings -> AI
providers). Map each deprecated variable to the field that replaces it.
* fix: renumber the legacy AI provider import after 0121_agent
Develop's core 0121_agent and this branch's import migration both depended on
0120, leaving two leaf nodes, so migrate refused to run and the startup check and
E2E shards failed. The import is now 0122 and depends on 0121_agent.
* feat: remove the legacy workspace generative AI settings endpoint
GET/PATCH /api/workspaces/{id}/settings/generative-ai/ had no caller left, yet a
PATCH was still honoured for any provider type without a workspace provider and
never shown in the AI providers UI. Remove it with the handler parameter,
receivers and frontend handler that only it could trigger.
* fix: stop instance AI provider changes from fanning out per workspace
An instance-level change queued one Celery task per 25 workspaces behind a global
blocking lock, sent a payload to every connected user, and made the premium receiver
serialize every AI field on the instance. Instance changes now notify staff only;
other users see them after a reload. The render lock is per scope, and the in-use
guards no longer read one row per workspace.
* fix: keep inherited Kuma when a workspace switches off the instance provider
The upgrade switches imported workspaces off the same-type instance provider, which
made an inherited instance Kuma model invalid there, so Kuma fell back to the
deprecated env model or turned off. Inheriting the instance Kuma selection now
ignores workspace switch-offs; explicit workspace selections stay strict and are
the only ones that block a switch-off.
* fix: skip malformed Ollama URLs during AI provider migration
* fix: preserve skipped legacy AI provider connections
* test: cover independent legacy AI workspace connections
* fix: skip malformed legacy AI provider settings
* fix: move legacy AI import after current core migrations
The linear rebase omitted the migration renumbering from the previous merge commit, while develop advanced through core 0124. Rename the existing AI import to 0125, depend on 0124, and update its historical migration test so core has a single leaf.
* feat: report when a button's row action points at the trash
* fix: keep a row action's mapping on a trashed field across edits
* fix: update buttons in other tables when their target is trashed
* feat: disable a button cell that needs reconfiguring
* feat: flag a row action that writes to a trashed field
* docs: describe the button reconfigure state in ADR 006
* test: cover a button healing when its mapped field is restored
* test: keep failing-click tests clickable under the reconfigure state
Give "Broken" and "BrokenChain" a table-targeting action that fails at
dispatch instead of one with no table, so requires_reconfiguration
stays false and the original click/toast assertions still run.
* perf: look up a button's own services in the reconfigure check
The uncorrelated subqueries scanned every upsert row service in the
instance, which the builder and automations share.
* perf: load mapped fields in one query when saving and serializing mappings
Update responses and realtime payloads read each mapping's field for
`trashed`, and saving looked each field up separately.
* fix: let undo restore the values of a mapping on a trashed field
The kept mapping was skipped, so replaying the exported mappings left its
current value and enabled flag in place.
* perf: skip the button lookup when no service depends on a trashed item
Every table and application created, and every field trashed, joined all
button fields and their actions even when no service pointed at it.
* fix: only offer restoring the field to heal a trashed field mapping
A permanent delete is cleaned up later without a broadcast, so an open
page never learns the action works again.
* fix: show the full label of a grid button that needs reconfiguring
The tooltip span shrink-wrapped the button, so its 90% max width
resolved against the span and cut the label short.
* fix: put a button using a trashed integration in the reconfigure state
The dispatch refuses a service whose integration is in the trash, so the
button now says so up front and open grids update on trash and restore.
* fix: update open grids when emptying the trash heals a button
Permanently deleting a trashed field or integration ends the reconfigure
state without any broadcast, so the cell stayed disabled until a reload.
* docs: note trashed integrations and permanent deletion in ADR 006
* fix: count a missing integration a button action needs
Deleting a trashed Slack bot left the action with none and re-enabled a
button that still fails. Also skips integrations outside a database, keeps
service lookups as subqueries, and stops a failed deletion leaking state.
* docs: note a missing required integration in ADR 006
* test: wait for a button field save to finish before moving on
The save sends the field update and each action call in sequence. A test
that navigated right after clicking Save could cancel the order call, so the
Stale button kept its old order and never navigated.
* fix: replace a row action's mappings with exactly what the payload sends
Keeping trashed mappings the payload left out stopped undo from removing them
and made undo raise on a mapping it had removed. The editor now sends them back.
* fix: leave the reconfigure flag out when the field refresh after a save fails
The mount-time value was written over whatever a broadcast had set since.
* fix: update buttons mapping a link field to a table that is trashed
Trashing a table trashes the link fields to it in other tables without a field_deleted signal.
* perf: send the buttons of a table in one message with their flags annotated
Every field_updated refreshes the grid, and an unannotated button cost queries of its own.
* fix: put a button whose target table is in a trashed workspace in the reconfigure state
An action can target a table in another workspace, and the dispatch refuses one whose workspace is trashed.
* fix: leave the buttons of a new table or database out of its broadcast
Duplication, template installs and imports send the created signals too, and nobody has the copy open.
* perf: pair each button service lookup only with the actions it backs
Also stop the early check deduplicating its UNION, and test that permanently deleting a builder integration never looks up buttons.
* fix: name each action that needs reconfiguring in the button editor
The field flag is now whether any action has the per-action flag, so the
editor can point at a trashed table, database or integration too.
* fix: keep the button flags out of the cached table model
They depend on other tables, so a model cached for the button's table served
them stale. They are now annotated only where fields are fetched to serialize.
* test: make the shared grid view private again after the public view test
A public view hides a field created in it until its editor closes, so the
retry test that runs later never saw its column.
* fix: update buttons mapping a link field to a table deleted from the trash
Deleting the table deletes the link fields to it and their mappings, with no signal of their own.
* fix: send a restored workspace's dependent buttons once and leave its own out
The once-per-restore check now keys the waiting on-commit callback by workspace id instead of relying on a shared Workspace instance.
* perf: leave a button's action state out of a service's table schema
The grouped aggregate rebuilds that schema uncached per property, and each
flag now cost a query per button. Nothing reads them from the schema.
* refactor: read an action's reconfigure flag straight from its definition
* fix: update buttons mapping a link field whose related field is purged
Emptying the trash for a link field also deletes its related field and that
field's mappings, which left buttons mapping it disabled until reload.
* fix: drop a mapping whose field was deleted from the trash on save
An open editor or an undo still sends the purged field's id, so every save
failed until reload. Fields that still exist elsewhere are still refused.
* fix: match no button for a lookup with no action model
An empty model list left the action filter empty, which matched every action
and would have sent every button in the instance.
* test: describe mappings replaced by the payload after a table change
The table change test sent no mappings, so it did not show a new table's
mapping replacing the old table's trashed one.
* fix: name a button action's trashed table instead of its fields
Trashing a table marks all its fields trashed, so the editor asked to restore a
field that only restoring the table brings back. The 404 from the fields fetch
now marks the table missing, and the action says so rather than a toast.
* fix: drop a mapping on another workspace's field instead of refusing it
Refusing it told the editor that the field exists.
* perf: send a button's state on its own realtime message
A `field_updated` makes the client refetch the whole grid, which for a flag
that says nothing about the rows throws away what someone is typing. The
signal also gives the enterprise restricted views a place to mirror from.
* fix: update buttons when a workspace is purged without being trashed
`delete_expired_users` and the admin panel delete a workspace outright, so
the `workspace_deleted` that would have flagged the buttons pointing into it
never goes out. A snapshot's application expires the same way.
* fix: flag an update row action that names no row
Every click on it is refused, so to the person clicking it is no different
to a target in the trash, but the button stayed enabled.
* fix: clear the server's reconfigure verdict when an action is edited
It describes the action as it was read, so the warning stayed up after a fix
until the save landed. Changing the type already dropped it by rebuilding.
* docs: name every cause of the button reconfigure state
The field and action descriptions each left one out, so they disagreed with
ADR 006 and with each other.
* test: expect the rowless button to render disabled
The server now flags an update row action with no row id, so the click the test made never lands.
* perf: serialize button fields once for all restricted views
Each serialization runs the reconfigure and action queries, which repeated for every view.
* perf: skip purged buttons and merge purge broadcasts
Buttons deleted with their container were collected for nothing, and a workspace purge
also purges its tables, so one button could be sent twice.
* fix: bump the global cache version
The button field schema dropped its action state, and cached schemas would keep the old shape.
* fix: keep the reconfigure verdict while the integration is unchanged
A trashed integration is missing from the list, so the verdict is the only warning.
* feat: per-feature and workspace-level AI model settings
Baserow could only point every AI feature at one instance-wide model. An
administrator can now register provider models, declare which AI features each
model may serve, and pick the default model per feature; a workspace admin can
inherit that choice, override it, or disable the feature locally.
The assistant resolves its model once per logical request and threads that
snapshot through its nested agents and tools, so a single run can no longer
re-read settings repeatedly or pick a model other than the one it validated.
The scoped provider state is memoized for the duration of a request, keeping
workspace serialization from loading it once per workspace.
Also:
- add Google and Groq provider types, and keep these database-only providers
out of the legacy workspace settings they cannot round-trip through;
- prune orphaned feature selections so an unloaded feature type's RESTRICT FK
no longer blocks provider and model deletion;
- record whether a configured model answers text and tool-calling probes, and
invalidate that result when its credentials or identifier change;
- broadcast provider and availability changes over the existing realtime
channel so open clients update without reloading;
- read the assistant model from the shared configmap, so frontend pods no
longer miss it on Helm installs.
Manual test instructions live in docs/testing/kuma-model-settings-test-plan.md.
* fix: address AI provider settings review feedback
* feat: add workspace AI providers for AI fields
* fix: address workspace AI provider review feedback
* fix: address remaining AI provider review feedback
* fix: resolve core migration conflict
* fix: stabilize premium AI provider tests
* address feedback for local imports
* feat: add instance AI provider management
* fix: simplify AI provider testing
* fix: remove extra model list spacing
* fix: show AI provider form errors inline
* fix: use icons for AI provider row actions
* fix: place model errors before help text
* chore: polish code
* fix: address feedback
* fix: address remaining frontend CI failures
* revert: undo unnecessary frontend changes from f6a7d302f
Revert all frontend changes introduced in "fix: bug in public view with
hidden group by" (f6a7d302f). The backend changes from that commit are
kept as they are the actual fix for the public view bug.
The reverted frontend changes caused a regression where group bys would
flicker (disappear and reappear) when changing the group by order,
because activeGroupBys was being cleared at the start of every refresh.
* fix: public view crash when group by is added or removed
Add ViewType.forceViewRefresh() method that handles updating the view,
fields, and (for grid views) activeGroupBys atomically during a
force_view_refresh realtime event. This prevents components from
accessing fields that have been removed or haven't been added yet.
Also fix LinkRowFieldType.isEqual crashing with null/undefined values
when rows have no linked items.
* fix: inconsistency in counting hidden fields in grid view
* fix issue deleting/restoring group bys