The accounts, subscriptions, invoices and payments lists read one Stripe
mapping per row. Each loader now reads its page's mappings in one query
before the row loop (ListCustomerMappingsByBillingAccountIDs,
ListSubscriptionMappingsBySubscriptionIDs, ListInvoiceMappingsByInvoiceIDs,
ListPaymentMappingsByPaymentIDs) and the loop looks each row up in the
result. A page with no rows reads nothing, and the payments list still
reads nothing without a Stripe querier. A failed batch keys nothing, so
every row shows not mapped, no Stripe id and no badge, as a row whose own
read failed did. GetPaymentMappingByPaymentID had no other caller and is
deleted. The per-row count of the four lists in
TestOperatorPagesReadAFixedNumberOfTimes goes from 2 to 1 (the
organization name is still read per row). The name resolver's indexBy
now has a production caller, so its test-only dead-code entry is removed.
failingMappingsStripeQ overrides the four batch reads in place of the four
single-row reads; its subtests are unchanged.
Shown to change no output: 39 breaks of the mapping reads, 15 run on the
parent and 24 on this commit, each caught by the test that pins it. The
eight golden files of the four lists are unchanged and no -update ran. The
names and results of cmd, internal/fulfillment,
internal/integrations/stripe, internal/server and internal/testkit (1758
results) are identical at the parent and at this commit. The walkthroughs
match the baseline (22 of 22) and the screens match it apart from the Stripe
integration page, whose size changes on every run. The lint snapshot differs
from the previous one by nothing.
Narrower than before: a failure of one row's mapping read alone cannot be
shown any more, since one query cannot fail for one row.
Unprobed: the payments list's empty page, because its batch is guarded on
the Stripe querier and the test that checks empty pages sets none; the lines
that fill the Stripe id, the sync state and the badge, which this commit
does not edit and the golden pins; the demo seed writes no Stripe mapping,
so the screens show only the unmapped branch; the payments list's guard on a
missing Stripe querier, because no test loads a payments page that has rows
and no querier (the start command sets the querier whether or not a Stripe
key is configured; a page without one would show every row as not mapped).