Skip to content

Commit a03b666

Browse files
committed
add debug logging for watch and unwatch target requests
1 parent c91a50f commit a03b666

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

packages/firestore/src/remote/remote_store.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
WatchTargetChange,
5656
WatchTargetChangeState
5757
} from './watch_change';
58+
import { canonifyTarget } from '../core/target';
5859

5960
const LOG_TAG = 'RemoteStore';
6061

@@ -331,6 +332,11 @@ function sendWatchRequest(
331332
remoteStoreImpl: RemoteStoreImpl,
332333
targetData: TargetData
333334
): void {
335+
logDebug(
336+
`sendWatchRequest (target id: ${
337+
targetData.targetId
338+
}) (target: ${canonifyTarget(targetData.target)})`
339+
);
334340
remoteStoreImpl.watchChangeAggregator!.recordPendingTargetRequest(
335341
targetData.targetId
336342
);
@@ -357,6 +363,7 @@ function sendUnwatchRequest(
357363
remoteStoreImpl: RemoteStoreImpl,
358364
targetId: TargetId
359365
): void {
366+
logDebug(`sendUnwatchRequest (target id: ${targetId})`);
360367
remoteStoreImpl.watchChangeAggregator!.recordPendingTargetRequest(targetId);
361368
ensureWatchStream(remoteStoreImpl).unwatch(targetId);
362369
}

0 commit comments

Comments
 (0)