Bug: Empty coValue update before content loading
Description
We're experiencing an issue where we emit an update with an empty coValue before emitting the content. This happens because we call markAvailable before loading the content.
Context
While working on the new subscription system, I've found this bug where we emit an update with an empty coValue before emitting the content because we call markAvailable before loading the content.
With the old version of the code, the fix was simple, but now it requires more careful consideration.
Proposed Solution
@aeplay suggests:
I think the ideal way to resolve this problem is by pulling precise peer state into CoValueCore and letting subscribers skip all updates until local state matches peer known state (either storage, or server or max(storage, server)).
I can try to do that in a follow up PR
Note: Fixing this should let us get rid of CoValueCoreSubscription