Your resident state of MA will tax all the income regardless of where earned.
Go to the deductions and credits section of the MA return, and then you will get a credit for taxes paid to another state (RI).
You always do the non-resident state prior to resident state and then TurboTax will compute the credit for you.