Use "Re-request keys" mecanism (Key-Sharing in the e2e implementation)
On a riot client, when a given client can't decode a message there is a link to "Re-request keys from another device", if that device is on, then it can load the message.
I believe what riot implements is https://matrix.org/docs/guides/e2e_implementation.html#key-sharing