MCPcopy
hub / github.com/facebook/react / finishAbortedTask

Function finishAbortedTask

packages/react-server/src/ReactFlightServer.js:5806–5829  ·  view source on GitHub ↗
(
  task: Task,
  request: Request,
  errorId: number,
)

Source from the content-addressed store, hash-verified

5804}
5805
5806function finishAbortedTask(
5807 task: Task,
5808 request: Request,
5809 errorId: number,
5810): void {
5811 if (task.status !== ABORTED) {
5812 return;
5813 }
5814 forwardDebugInfoFromAbortedTask(request, task);
5815 // Track when we aborted this task as its end time.
5816 if (
5817 enableProfilerTimer &&
5818 (enableComponentPerformanceTrack || enableAsyncDebugInfo)
5819 ) {
5820 if (task.timed) {
5821 markOperationEndTime(request, task, request.abortTime);
5822 }
5823 }
5824 // Instead of emitting an error per task.id, we emit a model that only
5825 // has a single value referencing the error.
5826 const ref = serializeByValueID(errorId);
5827 const processedChunk = encodeReferenceChunk(request, task.id, ref);
5828 request.completedErrorChunks.push(processedChunk);
5829}
5830
5831function haltTask(task: Task, request: Request): void {
5832 if (task.status !== PENDING) {

Callers 3

serializeThenableFunction · 0.85
retryTaskFunction · 0.85
finishAbortFunction · 0.85

Calls 5

markOperationEndTimeFunction · 0.85
encodeReferenceChunkFunction · 0.85
serializeByValueIDFunction · 0.70
pushMethod · 0.65

Tested by

no test coverage detected