Skip to content

Commit 61c8149

Browse files
committed
Add a comment to setBreadcrumbs
1 parent 36b0487 commit 61c8149

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sentry/src/main/java/io/sentry/cache/PersistingScopeObserver.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ public void addBreadcrumb(@NotNull Breadcrumb crumb) {
136136
@Override
137137
public void setBreadcrumbs(@NotNull Collection<Breadcrumb> breadcrumbs) {
138138
if (breadcrumbs.isEmpty()) {
139+
// we only clear the queue if the new collection is empty (someone called clearBreadcrumbs)
140+
// If it's not empty, we'd add breadcrumbs one-by-one in the method above
139141
serializeToDisk(
140142
() -> {
141143
try {

0 commit comments

Comments
 (0)