fast

Forgetfully eating while fasting

Q: I have started qadha fasting of my previous fasts which I did not make up in time. Today accidentally in morning I forgot that I am fasting and talking to my friend she offered me sweet and savoury and I tasted some of both. I did not even remember after sometime that I was fasting when during conversation I told her I am fasting nowadays and realised that I was fasting and have eaten by mistake. I know in Ramadan you can continue the fast but I don't know if it applies to qaza roza as well. Please tell me if my fast is valid or do I have to do anything else?