[lib] refine fetchFriendFIDs function
Summary: Made a few changes to fetchFriendFIDs in NeynarClient. These changes are mostly improvements to readability + organization of the function. I also implemented some basic error handling to catch any failed fetch requests
Test Plan:
Confirmed that everything still works for fetching farcaster data
- If there are no results (response is an empty array) the cursor is null and the loop does not run again
- If there are results, but the query limit is very small (i tested with setting the limit to 1) then cursor is set and the loop keeps on running until cursor is null and then the loop stops, and I get sent back all the relevant farcaster data
- If the number of results is less than the query limit then the cursor is null and the loop only runs once and I get sent back all the relevant farcaster data.
Reviewers: atul, inka, ashoat
Reviewed By: ashoat
Subscribers: ashoat, tomek
Differential Revision: https://phab.comm.dev/D11675