Twilight hears about Trixie's upcoming visit to Ponyville. Knowing that the pair didn't share the best bond in the past, Twilight uses this chance to improve what could be a very good friendship, despite disapproval from her friends.
This takes place around the middle of season four.