Problem
Whether a search snapshot has finished loading is inferred from a mix of fields (data, isLoading, type/status), which breaks when a request resolves with HTTP 200 but writes no data at all — nothing marks the snapshot as done, leaving the page stuck in a loading state. Search requests are read commands that never enter the offline queue, so the snapshot must own its own lifecycle.
Solution
Add an explicit state field (loading / loaded / error) to the search snapshot. getOnyxLoadingData writes loading optimistically on request start, a new successData branch writes loaded on any successful resolve (even without snapshot data), and failureData writes error. finallyData intentionally leaves state alone to avoid overwriting the error result. Network-level rejections apply failureData in a .catch() handler. This PR is write-side only; UI gates will migrate in a follow-up.
PR
#96043
Issue Owner
Current Issue Owner: @BartekObudzinski
Problem
Whether a search snapshot has finished loading is inferred from a mix of fields (
data,isLoading,type/status), which breaks when a request resolves with HTTP 200 but writes nodataat all — nothing marks the snapshot as done, leaving the page stuck in a loading state. Search requests are read commands that never enter the offline queue, so the snapshot must own its own lifecycle.Solution
Add an explicit
statefield (loading/loaded/error) to the search snapshot.getOnyxLoadingDatawritesloadingoptimistically on request start, a newsuccessDatabranch writesloadedon any successful resolve (even without snapshot data), andfailureDatawriteserror.finallyDataintentionally leavesstatealone to avoid overwriting the error result. Network-level rejections applyfailureDatain a.catch()handler. This PR is write-side only; UI gates will migrate in a follow-up.PR
#96043
Issue Owner
Current Issue Owner: @BartekObudzinski