next.js
6dc3a5a7 - Don't track modifications to transient data stored in tasks (#95133)

Commit
13 days ago
Don't track modifications to transient data stored in tasks (#95133) Many fields in TaskStorage store a mix of transient and persistent data. When we serialize we leverage the `filter_transient` tag (and the `IsTransient` trait) to avoid persisting it, however, when mutations occur we are still marking the tasks as `modified` even when we are only modifying transient data. This leads to unnecessary persistence cycles. The solution is simply to not call `track_modification` when the modification is about transient data items. For most fields this is handled in the macro accessors, but for `cell_data` this is managed via some new 'handwritten' mutators implemented on `TaskGuard`. This is desirable to decrease the number of times we do registry lookups since most callers who modify the cell_data already have the ValueType in hand
Author
Parents
Loading