Skip to content

Commit 6616307

Browse files
ivolivol
authored andcommitted
chore(android): add TODO for async pin notification in initialize()
notifyPinChangeListeners() still blocks promise resolution by ~2s via getPins()->refreshConfig()->CountDownLatch.await(no timeout). Low priority now that init-fetch is removed, but worth tracking for a future fix.
1 parent 3452f7e commit 6616307

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

android/src/main/java/io/approov/reactnative/ApproovService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,11 @@ public void initialize(String config, String comment, Promise promise) {
699699
clearEarliestNetworkRequestTime();
700700
if (isApproovEnabled()) {
701701
log(LOG_INFO, TAG, "initialized on deviceID " + Approov.getDeviceID());
702+
// TODO: notifyPinChangeListeners() calls getPins() which calls refreshConfig() and
703+
// blocks on a CountDownLatch with no timeout until a FetchConfig network request
704+
// completes (~2s on a blocked network). This delays promise resolution. Consider
705+
// moving this call to a background thread after promise.resolve(null) to make
706+
// initialize() return to JS immediately on all paths.
702707
notifyPinChangeListeners();
703708
} else {
704709
log(LOG_INFO, TAG, "initialized without Approov SDK");

0 commit comments

Comments
 (0)