Add logging to detect inconsistencies with peeked/polled animation operations

Summary:
Just trying something out.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34369919

fbshipit-source-id: 236f886fcc000a444bad494fd738688425159f21
This commit is contained in:
Joshua Gross
2022-02-20 12:23:41 -08:00
committed by Facebook GitHub Bot
parent 05b4570d3f
commit 7a3e6ae48f
@@ -252,6 +252,15 @@ public class NativeAnimatedModule extends NativeAnimatedModuleSpec
// won't cause any errors to execute it earlier than expected (just a bit of UI jank at worst)
// so we just continue happily along.
UIThreadOperation polledOperation = operationQueue.poll();
if (peekedOperation != polledOperation) {
ReactSoftExceptionLogger.logSoftException(
NAME,
new RuntimeException(
"Inconsistency detected: peeked animation operation different from polled: "
+ peekedOperation
+ " / "
+ polledOperation));
}
if (polledOperation == null) {
return;
}