Primaries for state and national offices except president were non partisan the whole time.[1] The Democratic Party allowed unaffiliated voters to vote in their presidential primary. Unlike the Republican Party.[2] And stating a preference isn't a loyalty oath.
I do remember not being able to vote in the primary, but I chalked it up to another weird California thing. I'm not sure how I don't count as unaffiliated but, regardless, the practice of not running an open primary is very strange to me coming from Texas.
[1] https://www.sos.ca.gov/elections/primary-elections-californi...
[2] https://www.sos.ca.gov/elections/political-parties/no-party-...