Open
Description
Summary
Massachusetts has just started its new General Court session (Court 194). To handle this on the site, we need to update our code to handle the new crop of legislators in the new session (so that users can accurately determine who their representatives are so they know where to send testimony).
We should automatically start scraping legislative members as soon as we add court 194 to our set of court constants (handled in #1677) - but we don't currently update user profiles to point to their new representatives if they change.
Work Detail
- Job/script that iterates over existing users who have added their representatives (known as
members
in Firestore) to their profile and updates those legislators- A user's representatives are stored under the
representative
andsenator
fields in the firestoreprofiles
collection - All
members
are scraped and stored undergeneralCourts/{courtNumber}/members
- We can safely ignore users who haven't added their representatives yet (since the search will start displaying the correct ones as soon as the new session is live).
- We can determine legislator changes by comparing the names on the
generalCourts/{courtNumber}/members
entries who match oncontent.District
(e.g. if the user's current representatives are not present in court 194 - find the members in court 194 whose districts match the districts of the user's current representatives and replace the old reps with the court 194 reps) - In some rare cases, there will be multiple active
members
in court 193. This occurs when amember
is replaced partway through a session. If this causes any issues, we should consider onlymembers
with committee assignments (incontent.Committee
) - replaced legislators will have their committee assignments removed, so that seems to be the best way to determine the active legislator when there are multiplemember
s for the same district in the same court session.
- A user's representatives are stored under the
Omissions
- We don't need to worry about this working for courts beyond 194 for this ticket - we'll likely implement a longer-term fix here before the next court session in two years