@@ -3,9 +3,15 @@ import * as serializr from 'serializr';
33import { observable } from 'mobx' ;
44
55import { HttpExchange , RawHeaders } from "../../types" ;
6+ import { ObservablePromise } from '../../util/observable' ;
7+
68import { EditableContentType , getEditableContentTypeFromViewable } from "../events/content-types" ;
79import { EditableBody } from '../http/editable-body' ;
8- import { syncBodyToContentLength , syncFormattingToContentType , syncUrlToHeaders } from '../http/editable-request-parts' ;
10+ import {
11+ syncBodyToContentLength ,
12+ syncFormattingToContentType ,
13+ syncUrlToHeaders
14+ } from '../http/editable-request-parts' ;
915
1016// This is our model of a Request for sending. Smilar to the API model,
1117// but not identical, as we add extra UI metadata etc.
@@ -70,6 +76,7 @@ export interface SendRequest {
7076 id : string ;
7177 request : RequestInput ;
7278 sentExchange : HttpExchange | undefined ;
79+ pendingSendPromise ?: ObservablePromise < void > ;
7380}
7481
7582const requestInputSchema = serializr . createModelSchema ( RequestInput , {
@@ -94,7 +101,8 @@ const requestInputSchema = serializr.createModelSchema(RequestInput, {
94101export const sendRequestSchema = serializr . createSimpleSchema ( {
95102 id : serializr . primitive ( ) ,
96103 request : serializr . object ( requestInputSchema ) ,
97- sentExchange : false // Never persisted here
104+ sentExchange : false , // Never persisted here (exportable as HAR etc though)
105+ pendingSendPromise : false // Never persisted at all
98106} ) ;
99107
100108export async function buildRequestInputFromExchange ( exchange : HttpExchange ) : Promise < RequestInput > {
0 commit comments