Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Blobs #5

Merged
merged 13 commits into from
Jul 5, 2022
Merged

Blobs #5

merged 13 commits into from
Jul 5, 2022

Conversation

boreq
Copy link
Contributor

@boreq boreq commented Jun 20, 2022

Related to #1.

boreq added 13 commits May 17, 2022 18:44
The code recognizes blobs in two message content types: about and post.

For about messages the code checks the "image" field. This field can be
a string containing a blob ref or a mention object.

For post messages the code checks the mentions field. This field is a
list of mention objects.
One thing that comes to mind is storing another reason for keeping a
blob e.g. explicit pin requests made by the UI. Another thing could be
caching the size of a blob.
Blobs are sent in chunks to avoid using up too much wire time in one
handler.
This implements replying to "wants" messages with "has" messages. "Wants" messages are received through `blobs.createWants` stream initiated by the local node and have to trigger a reply with a "has" message through `blobs.createWants` stream initiated by the remote node.
After this change the Swift code can request blobs to be downloaded and
the blobs remain in the want list for a specific amount of time. This
replace the previous approach of downloading all blobs right away and
copies the current behaviour exhibited by go-ssb. The new code behaves
slightly better as the want list isn't cleared when application exists
and is persisted.
@boreq boreq marked this pull request as ready for review July 5, 2022 12:50
@boreq
Copy link
Contributor Author

boreq commented Jul 5, 2022

I think it makes sense to either try to review this again and merge it or just merge it right away. At this point this functionality more-or-less works, we are not in production and this branch is basically blocking merges to master as I don't want to resolve conflicts afterwards.

@boreq
Copy link
Contributor Author

boreq commented Jul 5, 2022

Ok, after a short discussion let's just merge this.

@boreq boreq merged commit 455b5e2 into master Jul 5, 2022
@boreq boreq deleted the feature/blobs branch July 5, 2022 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant