עַד־עֵ֥ת בֹּֽא־דְבָר֑וֹ אִמְרַ֖ת יְהוָ֣ה צְרָפָֽתְהוּ׃
До того времени, когда слово его сбылось, Слово Господне испытывало его.
Malbim
1. To the suffering of a righteous person. That he had not worshiped with sincerity, for the sake of God alone, but had had other considerations in mind, such as the hope of reward and fear of punishment. Therefore, God refines him with suffering (Psalms 105:19), in order to humble him; to test him out; ultimately to benefit him (Deuteronomy 8:16) in the world to come.
Rabbeinu Bahya
It is quite possible that these words were meant to allude to happenings in the future, and that the oppression which Joseph underwent in that dungeon foreshadowed the exile of the Jewish people which has also been compared to a בור, a pit, a dungeon. This may have been the origin of the prayer in which we ask יעלה ויבא, “may He arise and arrive,” a request voiced in our prayers on days when we are especially conscious of the absence of the Temple service and the benefits it had conferred upon the Jewish people. It is a reference to the ascent of the Shechinah. Anyone who finds himself imprisoned in a dungeon needs to literally “arise” in order to get out of there. Just as the Shechinah did not forsake Joseph when he was in jail, so the Shechinah will not forsake the Jewish people just because they are in exile. Just as the Torah wrote concerning Joseph (Psalms 105,18) ברזל באה נפשו, “an iron collar was placed around his neck,” it is also written concerning Israel in exile (Psalms 107,10) יושבי חשך וצלמות אסירי עני וברזל, “some lived in deepest darkness, bound in cruel irons.” Just as we read concerning Joseph ויט אליו חסד, “He endowed him with kindness,” (verse 21) so we find concerning Israel in exile that the prophet says (Isaiah 54,10) וחסדי מאתך לא ימוש, “but My kindness will not depart from you.” Concerning Joseph the Torah writes (21) ויתן חנו בעיני שר בית הסוהר, “He put his favour in the eyes of the prison warden.” We find a corresponding statement in connection with Israel in exile when the psalmist writes (Psalms 106,46) ויתן אותם לרחמים לפני כל שוביהם, “He made all their captors kindly disposed toward them.” Just as Joseph eventually was released from prison and rose to unprecedented power and prominence, so the Jewish people will be redeemed from their exile as is written in Daniel 12,4 “as for you Daniel, obscure the matters and close the book and seal it until the time of the end; let many muse and let knowledge increase.”
Marit HaAyin
And Rabbi Elazar said: The Holy One, Blessed be He, exiled Israel among the nations of the world only so that converts would join them, etc. A great man asked me [how this can be] given that we were desecrated from sin (alluding to Psalms 51:7), and the eye can see that it is the opposite — many Jews in every place trade in their glory and become apostates, either out of danger, or out of a matter of sin or something similar, whereas the righteous converts [are so few] that a child can record them. So I answered him that it is because of the sparks of holiness and the holy souls that have been mixed up into the Other Side. And that is the reason for the exile of Israel in many lands and the ends of the world. And the essence of this is that, through the [suffering], the [performance of] the commandments, and the study [of Torah] in every place, holy sparks are separated and begin to rise to the divine presence every day. And they will rest there until the redemption will come; and then these sparks will, by way of the divine presence, publicly go back to holiness in the way of the Man. So our rabbis, may their memory be blessed, spoke well when they said that Israel was exiled among the nations of the world so that converts would join them, as they constantly separate the sparks of holiness and bring them up to the divine presence until the time of the end, and as they said. And all the exiles are to separate the holy sparks; and they are separated by the power of [the study of] Torah], the [performance of] the commandments, and the exile, by way of the divine presence. And all of this is [done] in actuality and potential, but just not publicly. So we do not know it until the word of God arrives [allusion to Psalms 105:19]. And the Kabbalists have said there need not be the exile of the Jewish people to a city to separate [the sparks]. Rather, even one person who goes to a different city and it appears in his eyes to be for himself or his place or this time — the essence of it is that this righteous person has several sparks that belong to his soul, and, with his going this way, he separates them. And in this manner, I humbly explained the verse, The path of the righteous is like radiant [nogah] light, ever brightening until noon (Proverbs 4:18). It is well-known that half of nogah [husks containing radiance] is in holiness and half of it is in the mundane. And through the Torah and the commandments, we separate it from the mundane part and bring it into holiness. And that is [the meaning of] The path of the righteous — if there are some righteous people who travel for their needs, know that the matter is not coincidental. Rather, it is the separation of nogah [that is happening], to separate the sparks of holiness that belong to their souls, like the radiant light [of the sun] that becomes clearer. So it becomes holy from the part of the mundane. So too, is the path of the righteous, in order to separate. And this separation is, ever brightening until noon and there shall then be a complete unification.