From 87dc9798906d52b9c9203f03cf6fced86a12e5e8 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Thu, 19 Sep 2019 19:23:49 -0400 Subject: [PATCH] Use `warnOnce` for excessive number of callbacks error --- Libraries/BatchedBridge/MessageQueue.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Libraries/BatchedBridge/MessageQueue.js b/Libraries/BatchedBridge/MessageQueue.js index 260a38f297dd15..93ac7436c1953f 100644 --- a/Libraries/BatchedBridge/MessageQueue.js +++ b/Libraries/BatchedBridge/MessageQueue.js @@ -16,6 +16,7 @@ const Systrace = require('../Performance/Systrace'); const deepFreezeAndThrowOnMutationInDev = require('../Utilities/deepFreezeAndThrowOnMutationInDev'); const invariant = require('invariant'); const stringifySafe = require('../Utilities/stringifySafe'); +const warnOnce = require('../Utilities/warnOnce'); export type SpyData = { type: number, @@ -225,11 +226,13 @@ class MessageQueue { const method = debug && this._remoteMethodTable[debug[0]][debug[1]]; info[callID] = {module, method}; }); - console.error( + warnOnce( + 'excessive-number-of-pending-callbacks', `Please report: Excessive number of pending callbacks: ${ this._successCallbacks.size - }. Some pending callbacks that might have leaked by never being called from native code:`, - info, + }. Some pending callbacks that might have leaked by never being called from native code: ${stringifySafe( + info, + )}`, ); } }