Closed ballPointPenguin closed 5 months ago
Good catch! I think it's actually dropping the final batch of comments, not the first. But yes, this is a bug.
I'd recommend sticking with the partial
implementation, as it's a bit more clojuric in this case. But not a big deal either way.
Actually, I think what we really want is (when (seq xids-batch) ...)
, since I'm not sure that we want to execute an upsert if the batch is empty for some reason. I don't know off the top of my head if that would result in a pg error, but maybe better on the safe side.
Confirmed that the original bug is dropping the final batch of XIDs, and that this change fixes that bug.
I'm still (after all these years) a relative clojure n00b, BUT it seems to me that this logic discards the first batch of xids when upserting the whitelist. e.g. If I give it a list of 200 xids, only 51-200 will be upserted and the first 50 discarded.
Does this make sense?