What is the problem?
With a large amount of data, sometimes the numbers of IPs returned for a particular proxy is different depending whether you call /proxies or /proxy/:label.
The same thing happens for /vpns v.s. /vpn/:label. See T348745#9260670.
Steps to reproduce problem
- Download {F37741556} and put it in the tmp/ directory of your ipoid install
- In the ipoid directory, run: docker-compose up -d
- docker-compose exec web node -e "require('./create-users.js')();"
- docker-compose exec web node -e "require('./init-db.js')();"
- docker-compose exec web ./diff.sh --today tmp/spur.v2.feed.luminati_proxy_100000.json.gz
- docker-compose exec web ./import.sh 0
- Run this python:
import requests proxies = requests.get("http://localhost:6927/feed/v1/proxies").json() proxy = requests.get("http://localhost:6927/feed/v1/proxy/LUMINATI_PROXY").json() # Number of IPs returned by /feed/v1/proxies len(proxies['LUMINATI_PROXY']) # Number of IPs returned by /feed/v1/proxy/LUMINATI_PROXY len(proxy)
Expected behaviour: The last two python lines should return the same number (I believe the correct answer is 99858)
Observed behaviour: The former returns 74253, the latter 99858.
Environment
ipoid commit 035cd08ca3aafbb4653c2f037225dd2386b015b1
Testing notes
Script to compare the accuracy of the API endpoints with the Spur JSON feed: https://gitlab.wikimedia.org/dwalden/ipmasking-testing/-/blob/main/ipoid_api_accuracy.py