Skip to content

Commit 1c1d4e8

Browse files
committed
refactor: make scope breadcrumb clearing explicit
Refs #5844 Signed-off-by: Md. Nazmus Salahin Rocky <rocky.bgta@gmail.com>
1 parent 4b12e21 commit 1c1d4e8

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

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

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,12 @@ public void addBreadcrumb(@NotNull Breadcrumb crumb) {
153153
}
154154

155155
@Override
156-
public void setBreadcrumbs(@NotNull Collection<Breadcrumb> breadcrumbs) {
157-
if (breadcrumbs.isEmpty()) {
158-
// we only clear the queue if the new collection is empty (someone called clearBreadcrumbs)
159-
// If it's not empty, we'd add breadcrumbs one-by-one in the method above
160-
if (!options.isEnableScopePersistence()) {
161-
return;
162-
}
163-
pendingBreadcrumbs.offer(CLEAR_MARKER);
164-
requestFlush();
156+
public void clearBreadcrumbs() {
157+
if (!options.isEnableScopePersistence()) {
158+
return;
165159
}
160+
pendingBreadcrumbs.offer(CLEAR_MARKER);
161+
requestFlush();
166162
}
167163

168164
@Override

0 commit comments

Comments
 (0)