RSU granted in MA but vested after I moved to CA. I am taxed by both states.

I moved from MA to CA in June 2021. Some of my RSU vested after I moved.

My paycheck and w2 shows that I payed taxes to both state.

CA treated 100% of vested RSU as income.

MA treated a portion of it as income. (My employer told me that was because those RSU were granted in MA)

 

I think I am a part-year resident in MA. According to this page from mass.gov:

Part-year residents - Include gross income from all sources during your residency period.
Nonresidents - Include gross income from sources in Massachusetts. 

I have three questions:

 

  1. Does that mean the RSU income after I moved out of MA in 2021 should not be taxed by MA?
  2. My paycheck shows that in 2022 (I am a CA resident), vested RSU are still being taxed by MA. Is that because those RSU are considered from "Massachusetts source"?
  3. How do I prevent myself from being double taxed? For 2021, can I just remove those RSU income from MA gross income? For 2022, should I get tax credit from CA for the RSU taxes I paid to MA?