Double taxation if both NY and CA resident

Hi, I have been a long time California Resident. I now work for a Washington state company but I wish to spend some time in NY since I have chance to work remote. From what I gather, if I am a non resident in NY, I can use credits I pay for NY tax to offset CA so I don't get double taxed. https://ttlc.intuit.com/community/state-taxes/discussion/double-taxation-between-ca-ny-nj/01/1290202...

 

I want to confirm that this is true even if I am both a NY and CA resident. For example, if I accidentally stay > 183 days in NY, and CA still considers me a resident, would I then get double taxed on all my income? Or could I still use one tax to offset the other?