Repository navigation
Commit d343d0e
authored
fix(memory-storage): Avoid duplicate processed requests in memory request queue client (#1941)
## Description
- `MemoryRequestQueueClient.add_batch_of_requests` appended a
`ProcessedRequest` twice for requests that were already present in the
queue but not yet handled — once in the `was_already_present` branch and
again at the unconditional append after the if/else block, which that
branch did not skip.
- This violated the contract that
`AddRequestsResponse.processed_requests` contains exactly one entry per
input request and inflated results for any caller iterating the list.
- Removed the inner append so the shared append at the end handles both
branches, matching the structure of the file system client. Added a
regression test.1 parent 9ce5a43 commit d343d0e
2 files changed
Lines changed: 17 additions & 8 deletions
File tree
- src/crawlee/storage_clients/_memory
- tests/unit/storage_clients/_memory
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 193 | | |
202 | 194 | | |
203 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
46 | 63 | | |
47 | 64 | | |
48 | 65 | | |
| |||
0 commit comments