You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -195,10 +202,11 @@ export class StreamTransport extends DataConnectTransportClass {
195
202
variables: Variables
196
203
): string{
197
204
// TODO: should this be simpler? maybe it should be similar to the execution request ID...? the only reason we need a unique AND identifying ID is so the SDK can lookup for an existing request when we want to unsubscribe, so maybe let's keep the complexity on the SDK side only
198
-
returnencoderImpl({
205
+
constqueryKey=encoderImpl({
199
206
name,
200
207
variables
201
208
});
209
+
return`subscribe-${queryKey}`;
202
210
}
203
211
204
212
/**
@@ -259,17 +267,53 @@ export class StreamTransport extends DataConnectTransportClass {
const{ resolve, reject }=this._executeRequests.get(requestId)!;// TODO: might not exist... remove "!"
267
-
resolve(msg);// TODO: do something with the message other than just pass it along, depending on message type - we should be resolving to DataConnectResponse<Data> if it succeeds
268
-
this._executeRequests.delete(requestId);// TODO: not necessarily an execute. only delete if this an execute
resolve(response.data);// TODO: do something with the message other than just pass it along, depending on message type - we should be resolving to DataConnectResponse<Data> if it succeeds
@@ -308,6 +352,7 @@ export class StreamTransport extends DataConnectTransportClass {
308
352
variables?: Variables
309
353
): Promise<DataConnectResponse<Data>>{
310
354
constrequestId=this._makeExecuteRequestId();
355
+
// TODO: "To save bandwidth, the Data Connect SDK should include data_etag of cached data in subsequent requests, so the backend can avoid sending redundant data already in SDK cache.
311
356
constbody: ExecuteStreamRequest<Variables>={
312
357
'name': this.connectorResourcePath,
313
358
requestId,
@@ -329,6 +374,7 @@ export class StreamTransport extends DataConnectTransportClass {
// TODO: "To save bandwidth, the Data Connect SDK should include data_etag of cached data in subsequent requests, so the backend can avoid sending redundant data already in SDK cache.
0 commit comments