konklone / congress-android

Congress for Android, an app for tracking Congress.
https://play.google.com/store/apps/details?id=com.sunlightlabs.android.congress
Other
157 stars 43 forks source link

Move bills to the Pro Publica Congress API #690

Closed konklone closed 7 years ago

konklone commented 7 years ago

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:

konklone commented 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.