Store PSS messages when there is no subscriber
Summary
The docs state that a node receives the PSS messages at startup if it was offline. The issue is when the node is starting and there isn't any subscriptions to a topic the message won't be published through the websocket.
Motivation
We are implementing a file sharing feature using PSS messaging and the recipient cannot be notified if it is offline, because it cannot subscribe in time.
This is also the case when the node is online, but nobody subscribed to a topic.
Implementation
At startup save the messages to a temporary store. When some subscribes to a topic check the store for messages and publish them, then remove from the store.
When we receive a PSS message check if there is a subscriber to the topic and put it to the store if there is none. If there is, then publish it as usual.
Drawbacks
Change in the API behavior? Additional storage capacity requirement (can be limited to n chunks).