Skip to content

Commit ff388f2

Browse files
committed
SyncEngine.java: add log messages that include the contents of activeLimboTargetsByKey to see if removeLimboTarget() is erroneously not finding document keys in it
1 parent 422b8ef commit ff388f2

File tree

1 file changed

+15
-1
lines changed
  • firebase-firestore/src/main/java/com/google/firebase/firestore/core

1 file changed

+15
-1
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/core/SyncEngine.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,11 +550,25 @@ private void removeAndCleanupTarget(int targetId, Status status) {
550550
}
551551
}
552552

553+
private String describeKeyInActiveLimboTargetsByKey(DocumentKey key) {
554+
ArrayList<String> list = new ArrayList<>();
555+
for (DocumentKey currentKey : activeLimboTargetsByKey.keySet()) {
556+
list.add(currentKey.toString());
557+
}
558+
Collections.sort(list);
559+
return "activeLimboTargetsByKey.containsKey(key)="
560+
+ activeLimboTargetsByKey.containsKey(key)
561+
+ " (by string: "
562+
+ list.contains(key.toString())
563+
+ ") activeLimboTargetsByKey="
564+
+ list;
565+
}
566+
553567
private void removeLimboTarget(DocumentKey key) {
554568
// It's possible that the target already got removed because the query failed. In that case,
555569
// the key won't exist in `limboTargetsByKey`. Only do the cleanup if we still have the target.
556570
Integer targetId = activeLimboTargetsByKey.get(key);
557-
Logger.warn("zzyzx", "removeLimboTarget() start; key=" + key + " targetId=" + targetId);
571+
Logger.warn("zzyzx", "removeLimboTarget() start; key=" + key + " targetId=" + targetId + " " + describeKeyInActiveLimboTargetsByKey(key));
558572
if (targetId != null) {
559573
remoteStore.stopListening(targetId);
560574
activeLimboTargetsByKey.remove(key);

0 commit comments

Comments
 (0)