In my last relationship, my ex sometimes went overboard with joking about infidelity, however, one time when i confronted her, she drew the "we're heading for a breakup anyway" with that i answered "what?" Whereafter she changed topic. This was via text. I instantly got loaded with fear as she drew the "breakup card" this happened everytime i tried to set boundaries, at my attempts ended up being half assed as a result.

After a year, im talking with her again, fully platonic. She mentioned some days ago that she was sorry for some of her behavior in the relationship, also regarding thoughts of infidelity, which i got frustrated about.

How could i have handled this differently? And would it be a good idea to dig up these topics and discuss them with her to get a better understanding of how i behave in these situations?

TL;DR: had a girlfriend tresspassing boundaries i was too afraid to set clearly. What can i do to not get into this situation again?