Closed konklone closed 7 years ago
Whew! Finally, legislators and bills are now completely moved to the Pro Publica API.
Everything ported, including bill searching. I didn't have to remove any features. I tested out a migration path with legislators and bills starred, and various notifications turned on, and the migration worked without crashes or bugs.
Where there is an issue that I have to consider (in a future issue/PR) is how to handle push notifications users are due to get. Some will be from the fact that the PP API differs somewhat for some endpoints, so search results and feeds will show some new information. That's okay (though still undesirable). Less okay is that all bill actions and bill votes will get falsely notified as new, because the ID format changed (away from a timestamp and over to an ID-based scheme).
What I may want to do is have a post-install hook that does a quick scan for all (or some?) existing notification subscriptions, and marks everything as "seen" without notifying the user. There's no feature for post-install hooks in the app, but I could add one if I wanted.
In any case, this is still releasable if I wanted to, so, merging and moving on.
This moves all of the bill-fetching code to use the Pro Publica Congress API. There should be no remaining areas where we hit the Sunlight congress API's
/bills
endpoint.It also moves a couple of straggling Legislator-fetching endpoints over.
There are still a few outstanding issues before this is mergeable and/or releasable:
offset=0
for the first page of results. Right now all bill listing requests only fetch page 1 (nooffset
parameter sent), no matter what page the code is requesting. This must get restored before shipping, as it's clear breakage right now.Active
bill feed to use theupdated
list in the PP API, but the signal-to-noise ratio is much higher here than before. Since the PP API does have a concept of (and flag for) whether a bill isactive
, I've requested a filter and feed foractive
bills in https://github.com/propublica/congress-api-docs/issues/71. I'd ideally like to see this ship and then move the app to use it, since the signal-to-noise ratio is relevant to how users get push notified.id
field to actions in the order they are made, which will let us proceed.voted_on
back tovoted_at
by parsing thetime
field available on bill votes. [Edit: Ended up doing this by appending theroll_id
to thebill_id
. This works for as long as votes are always roll call votes (which is the case in the PP API).