Skip to content

Commit f9f2885

Browse files
committed
fix: remove all items instead of just the ones to be inserted
1 parent 28e295c commit f9f2885

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/Boutique/Store.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ internal extension Store {
388388
var currentItems = await self.items
389389

390390
if let strategy = existingItemsStrategy {
391-
var removedItems = [item]
391+
var removedItems = currentItems
392392
try await self.removeItemsFromStorageEngine(&removedItems, withStrategy: strategy)
393393
// If we remove this one it will error
394394
self.removeItemsFromMemory(&currentItems, withStrategy: strategy, identifier: cacheIdentifier)
@@ -413,7 +413,7 @@ internal extension Store {
413413

414414
if let strategy = existingItemsStrategy {
415415
// Remove items from disk and memory based on the cache invalidation strategy
416-
var removedItems = items
416+
var removedItems = currentItems
417417
try await self.removeItemsFromStorageEngine(&removedItems, withStrategy: strategy)
418418
// This one is fine to remove... but why?
419419
// Is it the way we construct the items in the ordered dictionary?

0 commit comments

Comments
 (0)