Well, I think they attacked when they did on direct orders from Iran and I also think that the peace talks with Saudi played a big role in the order being given.Maybe Hamas was waiting until after the prisoner exchange grift, so as to not screw that up.
Who knows?