Closed FrontiniFederico closed 7 months ago
Hi, can you put in a check directly after building your trimmed_response list and before executing your "delete" loop in order to ensure that your trimmed_response does not include any duplicates in the first place. for testing purpose you could add something quick-and-dirty like:
duplicates = [
x
for x in trimmed_response
if [e["id"] for e in trimmed_response].count(x["id"]) >= 2
]
if duplicates:
print("Error: There are the following duplicate IDs: ", duplicates)
The #18 you refer to relates to a fix in the realtime service which is not relevant here as you use the normal record service.
Are you sure that you are the only user of your pocketbase instance? If someone else is concurrently deleting elements from the pocketbase every once in a while while your code excecutes the behaviour you see would be somehow "expected".
The code being executed within this library to delete a record is rather straightforward and well covered by our library integration tests. In that sense you should double-check if your problem is not related to your specific context and/or environment somehow.
closed due to inactivity
Problem Description
While iterating through a list of dictionaries, rarely and very randomly a ClientResponseError gets raised. From Pocketbase logs I can see that the following code somewhat tries to delete the same key twice, resulting in this issue. It does seem a kind of race condition of some sort?
Steps to Reproduce
I have not much to say here, I can paste the code that results in this error but it's very sporadic:
Expected Behavior
I wouldn't expect this code to randomly try to delete the same key twice.
Current Behavior
Somehow, it does. I think that #18 tries to fix this?
Context