For those of you still scratching your heads over the timing of S7E6, please watch the opening scene again.
It's a fire place & from there we go to an aerial view of Jon's party north of the wall.
There's only one person who views events from above: Bran.
Bran saw they were in trouble & started sending ravens out. We saw him do so earlier in the season, so there's no reason not to believe he didn't do so this time. So by the time Gendry runs all the way back to the Wall (thank God he never skipped leg day!), Dany's already flying north on the dragons.