There were once two heretics (According to one version: Tzedokim), one whose name is Sasson (joy), and one whose name is Simchah (happiness).
Sasson said to Simchah: I am better than you, as it is written: "Sasson and Simchah they will attain" (Yeshayahu 35:10) (The claim of superiority is based on which word comes first in the verse)
He (Simchah) said to him (Sasson): I am better than you, as it is written: "Simchah and Sasson for the Jews" (Esther 8:17).
Sasson said to Simchah: One day they will leave you and make you a runner (one who goes out in front of people), as it says: "For in Simchah they will go out" (Yeshayahu 55:12).
Simchah said to Sasson: One day they will leave you and water will be drawn by you, as it says: "And you will draw out water in Sasson" (Yeshayahu 12:3)
The heretic by the name of Sasson said to Rebbi Abahu: In the future you (the Jews) will draw water for me, as it says: "And you will draw out water in Sasson" (Yeshayahu 12:3)
He (Rebbi Abahu) said to him (Sasson): If it was written "to Sasson", it would be as you said, but now that it is written "in Sasson", from the skin of that man meaning Sasson), we will make a pitcher and fill it with water.
Kol HaTor Chapter 2, Part 1, Page 74
147) Sasson and Simchah – In the verse: And the redeemed of Hashem will return, etc, Sasson and Simchah they will attain (Yeshayahu 35). Sasson and Simchah are the 2 Moshiachs and the main matter of Sasson is Moshiach ben Yosef about whom this pasuk is said, “and the redeemed of Hashem will return”, according to our Rabbi (the GR”A) in Sod HaOtiot Chafa”f (in Likutei HaGR”A), this is the main meaning of the Gemara (Sukkah 48b, quoted above) on the matter of Sasson and Simchah. And our Rabbi (the GR”A) merited to attain understanding of the meaning of that Gemara in all its purpose, and about this he said that if he was created only to understand this matter, it is enough for him….
For a thorough yet partial explanation of this matter, see Sefer Pitchei She’arim part 1, back of the book, Beit Netivot, page 26. It is too long and complicated for me to type up here. Some points can be gleaned from this. Per the GR”A, the Gemara there is referring to the time when the 2 Moshiachs will be caught up in the Klipot, the period which I have written of, from the GR”A’s era until our era. They are Tzedokim (heritics) as long as they are caught up in the Klipah. When they are freed, they are Tzadikim. First, Sasson (Moshiach ben Yosef) will be freed of his Klipah, and then Simchah (Moshiach ben Dovid).