Skip to content
This repository was archived by the owner on Sep 21, 2026. It is now read-only.

Commit 14a0c36

Browse files
cursor[bot]cursoragentChiragAgg5k
authored
fix: refresh $updatedAt after inline row edits (#3170)
* fix: refresh $updatedAt after inline row edits Inline spreadsheet edits called updateRow but kept the pre-write row in local state, so $updatedAt never changed until a full reload. Apply the API response system fields before updating the grid (console#2873). Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com> * chore: retrigger CI Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com> * chore: nudge CI for stuck Tests queue Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: chiragaggarwal5k <chiragaggarwal5k@gmail.com>
1 parent bdfadb1 commit 14a0c36

1 file changed

Lines changed: 21 additions & 13 deletions

File tree

  • src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]

‎src/routes/(console)/project-[region]-[project]/databases/database-[database]/table-[table]/spreadsheet.svelte‎

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -681,24 +681,31 @@
681681
}
682682
}
683683
684-
async function updateRowContents(row: Models.Row) {
684+
async function updateRowContents(row: Models.Row): Promise<Models.Row | false> {
685685
try {
686686
const payload = buildPayload(table.fields, row);
687687
688-
await sdk.forProject(page.params.region, page.params.project).tablesDB.updateRow({
689-
databaseId,
690-
tableId: table.$id,
691-
rowId: row.$id,
692-
data: payload,
693-
permissions: row.$permissions
694-
});
688+
const updated = await sdk
689+
.forProject(page.params.region, page.params.project)
690+
.tablesDB.updateRow({
691+
databaseId,
692+
tableId: table.$id,
693+
rowId: row.$id,
694+
data: payload,
695+
permissions: row.$permissions
696+
});
697+
698+
// Keep client-side relationship expansions; refresh system fields from the API
699+
// so columns like $updatedAt reflect the write (inline edit does not invalidate Dependencies).
700+
row.$updatedAt = updated.$updatedAt;
701+
row.$permissions = updated.$permissions;
695702
696703
trackEvent(Submit.RowUpdate);
697704
addNotification({
698705
message: 'Row has been updated',
699706
type: 'success'
700707
});
701-
return true;
708+
return row;
702709
} catch (error) {
703710
addNotification({
704711
message: error.message,
@@ -1179,12 +1186,13 @@
11791186
{row}
11801187
column={rowColumn}
11811188
onRowStructureUpdate={async (row) => {
1182-
const success = await updateRowContents(row);
1183-
if (success) {
1189+
const updated = await updateRowContents(row);
1190+
if (updated) {
11841191
// database update succeeded!
1185-
paginatedRows.update(index, row);
1192+
paginatedRows.update(index, updated);
1193+
return true;
11861194
}
1187-
return success;
1195+
return false;
11881196
}}
11891197
noInlineEdit={isRelatedToMany && hasItems}
11901198
onChange={(row) => paginatedRows.update(index, row)}

0 commit comments

Comments
 (0)