File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
src/devtools/components/main-content/object-store-view Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/).
77
88### Added
99
10+ - Optimistically update cell values before saving the value to IndexedDB but revert it in case of failures. This makes
11+ the update faster from a user perspective since we don't wait for it to be committed to IndexedDB first.
1012- Distinguish the extension installed in dev mode from the one installed from the Chrome Web Store.
1113
1214## [ 1.0.1] - 2025-11-28
Original file line number Diff line number Diff line change @@ -206,8 +206,12 @@ export default function Table(props: TableProps) {
206206 setErrorMsg ( `Cell update reverted: ${ DATA_MUTATION_ERROR_MSG } ` ) ;
207207 return ;
208208 }
209+ // store the old value in case the update in indexedDB fails
210+ const oldValue = params . data [ col . name ] ;
209211 let newValue = parseBooleanNull ( params . newValue , col . datatype ) ;
210212 newValue = convertGetterValueToRowDataValue ( newValue , col . datatype ) ;
213+ // optimistically update the cell value
214+ updateRowData ( params . api , params . data , col , newValue ) ;
211215
212216 try {
213217 await updateField ( {
@@ -218,9 +222,8 @@ export default function Table(props: TableProps) {
218222 fieldToUpdate,
219223 newValue : { value : newValue , datatype : col . datatype } ,
220224 } ) ;
221- // after the update succeeded in indexedDB, update the table data
222- updateRowData ( params . api , params . data , col , newValue ) ;
223225 } catch ( e ) {
226+ updateRowData ( params . api , params . data , col , oldValue ) ;
224227 const msg = e instanceof Error ? e . message : DATA_MUTATION_ERROR_MSG ;
225228 setErrorMsg ( `Cell update reverted: ${ msg } ` ) ;
226229 }
You can’t perform that action at this time.
0 commit comments