Dropping a mail-in ballot in person seemed to have no plausible subreptitious election integrity attack I could think of though.
To be honest, the numbers are always off by 1-5 (in a precinct of ~1,500 registered voters, with ~100 physical ballots cast) simply because poll workers are generally undertrained and out-of-practice so mistakes are made throughout the day. But the system at least does a decent job of limiting the amount of fraud that could happen at a single polling location. And there are hundreds throughout the city.
Source: am an SF election inspector.
I do quite like that permanent residents like me are allowed to be a poll worker in SF...
Looking at https://en.wikipedia.org/wiki/Open_primaries_in_the_United_S... it looks like 17 states have completely open primaries. 4 more are like Massachusetts. 3 more have open or semi-open primaries on the Democratic side only.
While you can register as a member of one particular party in order to vote in that party's primary election, you certainly don't have to, and it has nothing to do with how you vote in the general election. In some states, even if you are "unaffiliated" you can participate in one party's primary in that state as well.