Fix future IPFS Pinning regression on postgres based Nodes #81
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR intends to fix a regression that will occur when the PostgreSQL API is live on pyaleph.
STOREmessage won't display file size anymore. To solve this issues, file sizes will be fetched on a separate endpoint and merged at display.This PR has no effect when using the current API
Source and additional context
Here is the same store message on current API and a Node using the new postgresql implementation:
Notice that the
sizekey is missing on the latter. To fix this, we use the new/api/v0/addresses/filesendpoint to retrieve the missing information.Misc. fix
It also fixes the way the current
usedspace is calculated, it was previously computed on client side, by summing the size of store message posted on thePINNINGchannel, this had several caveat (ie.: the used space relied on the number of fetched items). It is now directly returned by the API on/api/v0/addresses/files