The "Duet" episode of The Flash is an impromptu crossover with Supergirl. It seems Music Miester has an axe to grind with the fastest man alive. So he hypnotizes Kara and uses her portal key to warp to Earth 1. Since Music Meister went to Earth 1, Mon El and Martian Man-hunter arrive on Earth 1 for help. It seems the Meister decided to trap Supergirl in the same projected reality as the Flash, in an attempt to teach him/them a lesson. Whatever that lesson was is TBD.
Since Both Kara and Barry love musicals it seems that's why their dream was projected into the setting it was. A 1940's gangbuster era romp complete with tuxes and tommy guns. They had to help a young couple, Mon El and Iris stay together and survive the gang war their fathers would start to keep them apart.
Of course during the events of the musical, both Barry and Kara gain new perspective on their respective relationship woes. Kara discovers why she should forgive Mon El not revealing to her, that he was the crown prince of Daxom, not just a regular Daxomite. While Barry and Iris rediscover that nothing is more important than being together.
This results in Barry proposing again and Iris accepting again. The break is over, Music Meister is really cupid and finally, all is right with the world. I guess it was quick one-off way to reach the conclusion it did. While it wouldn't be my first choice for a story telling medium, I'm glad "Duet" yielded a desired effect and wrapped up a situation that could have dragged on for some time.