One thing the Dronefly bot does is produce displays that include counts of each individual’s observations & species, and a total line at the bottom which, in a single API call, totals up how much they have together. The observations of each individual should add up to the total, and the species count should be a superset. And that worked reliably until I saw it break with one particular user when their observations were added to the display. I can’t for the life of me figure out why. It’s easily reproducible on the web with the same queries the bot uses.
5 observations, 3 species here? What happened to the other 15 observations by dendrocygna? It seems it has only counted one, and the rest have been thrown into the bit bucket.
I tried going and saving each of those taxa, and it seemed to have made O. bilamellata show up. I saved each of the taxa from Aeolidia to Nudibranchia and then the observation count went up to 14 but the species didn’t change.
Strange. OK, so now I know a procedure to fix it if it happens again, but I’d sure like to know why that works at all. I guess some index that isn’t used when searching for a single user_id, but only used when there are multiple was broken?
My first thought was that a taxon didn’t get updated properly, and resaving them pushes that through. Changing the DQA does the same for individual observations but I’ve never had to try both before. In other similar issue I’ve had the observation(s) would have showed up or not regardless of how many users there were so that’s a little strange. I also don’t know that it wasn’t just one thing that fixed it and took a while to update.
I don’t really know how the underlying code works but that sounds plausible to me.
Note: the numbers have changed since I left this comment yesterday, as one of the users added more observations, but the problem still exists for the 1st URL and can be worked around with the last one.
i’m just guessing here, but i suspect when you do a user_id=[single user login] query, it will lookup the numeric id based on login and then get results from the database using user_id=[single user id]. but when you do a user_id=[multiple user login] query, it will switch to user_login=[multiple user login].
so it must be making that tie some other place. i’m not certain how ElasticSearch indexes work, but i suspect the problem is there. if the tie between observations and old logins occurs in one of those, then i guess those indexes just need to be updated whenever a user changes their login.