Skip to content

Global: Standardize List Refresh After Mutation (addRecord/create/update/delete) Across All ObjectUI Scenarios #1126

@hotlong

Description

@hotlong

After thorough code analysis of the entire ObjectUI codebase, I identified this as a platform-level architectural design deficiency, not just a single bug. Here's the complete assessment:

5 Root Causes Identified

# Root Cause Affected Packages Severity
1 No unified event-driven refresh modelDataSource.create/update/delete completes silently; no active views are notified @object-ui/types, all consumers 🔴 Critical
2 ListView lacks imperative refresh() APIonAddRecord is fire-and-forget, parent cannot signal re-fetch plugin-list 🔴 Critical
3 refreshKey not propagatedObjectView.handleFormSuccess increments its own refreshKey, but renderListView renders a ListView with an independent refreshKey plugin-viewplugin-list 🔴 Critical
4 Schema-level refreshAfter not universally honored — only works in RecordDetailView actions, not in addRecord, bulk ops, lookup quick-create, etc. plugin-view, plugin-detail, plugin-list 🟡 High
5 Duplicated manual fetchData/setRefreshKey boilerplate — User, Org, Role, Permission pages each hand-roll their own refresh logic apps/console 🟡 Medium

3-Phase Solution Proposed

Phase Scope Key Deliverables
P0 — Immediate Fix Pass refreshKey through renderListViewListView + add refreshTrigger prop Fixes the reported bug
P1 — Imperative API ListView exposes ref.refresh() via forwardRef + useImperativeHandle; abstract useListRefresh hook Any parent can trigger refresh
P2 — Event Bus DataSource.onMutation() subscription; all views auto-refresh on relevant object mutations Salesforce/Retool/Airtable parity

Industry References

The issue includes design comparisons with:

  • Salesforce LightningrefreshApex / force:refreshView event bus
  • Retoolquery.trigger() invalidation
  • AppsmithonSuccess → listQuery.run() action chaining
  • Airtable — Optimistic insert + server-confirm sync

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions