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

Blob work: Request blobs that have been mentioned in a post and store them #19

Open
4 tasks
nichoth opened this issue Jan 10, 2022 · 2 comments
Open
4 tasks
Assignees
Labels
enhancement New feature or request

Comments

@nichoth
Copy link
Contributor

nichoth commented Jan 10, 2022

Overall GOAL: We want to request any blobs that have been mentioned in a post and save it to our server.

choose a pub to request a blob from

  • should iterate through our list of known pubs

stream errors

  • listen for errors in the pull stream with each pub. (the muxrpc stream)
  • if the stream doesn't work, should move on to the next one in our list

  • should preemptively replicate blobs, not just when they are requested by a user. See this issue

https://github.com/ssbc/ssb-server/blob/99fad7c5f6e436cbd670346b4da20c57222a1419/plugins/blobs/replication.js#L190

// monitor the feed for new links to blobs
  pull(
    sbot.links({dest: '&', live: true}),
    pull.drain(function (data) {
      // do we have the referenced blob yet?
      sbot.blobs.has(data.dest, function (_, has) {
        if(!has) createJob(data.dest, data.source)
      })
    })
  )

You could use jitdb's predicate to check that a mention starts with the character & and run it with live(), or you could use the fullMentions leveldb in ssb-db2 but you'd have the add more code to the source code for doing this live logic.

@nichoth nichoth self-assigned this Jan 10, 2022
@nichoth nichoth added the enhancement New feature or request label Jan 10, 2022
@nichoth nichoth moved this from This Sprint to In Progress in Planetary Webapp & Viewer Jan 10, 2022
@nichoth nichoth moved this from In Progress to This Sprint in Planetary Webapp & Viewer Jan 11, 2022
@nichoth nichoth moved this from This Sprint to In Progress in Planetary Webapp & Viewer Jan 11, 2022
@nichoth nichoth moved this from In Progress to This Sprint in Planetary Webapp & Viewer Jan 11, 2022
@nichoth nichoth moved this from This Sprint to In Progress in Planetary Webapp & Viewer Jan 11, 2022
@nichoth nichoth moved this from In Progress to Backlog in Planetary Webapp & Viewer Jan 11, 2022
@rabble rabble moved this from Backlog to This Sprint in Planetary Webapp & Viewer Jan 18, 2022
@nichoth nichoth moved this from This Sprint to In Progress in Planetary Webapp & Viewer Jan 18, 2022
@nichoth
Copy link
Contributor Author

nichoth commented Jan 24, 2022

ssbc/ssb-db2#307

Blob replication is handled entirely by the plugin ssb-blobs

Why is this not my experience? We see broken links unless we explicitly replicate blobs.


See the push method

via %2s32sWdS14QUKXECTGmwSjTN9fost9eV6TdedsCcSvc=.sha256

We don’t do anything different in Manyverse in comparison to (say) Patchwork. The plugin we use is ssb-blobs, and I think one important part of that subprotocol is to “push” the blobs to peers connected, not just make it available for “pull”, which is the request thing you mentioned.


push though is only relevant if a client is posting a new message... for a viewer app we would need to get blobs as we notice them being referenced.

links to relevant posts

@nichoth nichoth moved this from In Progress to This Sprint in Planetary Webapp & Viewer Jan 24, 2022
@rabble rabble moved this from This Sprint to Blocked in Planetary Webapp & Viewer Jan 24, 2022
@nichoth nichoth moved this from Blocked to In Progress in Planetary Webapp & Viewer Feb 2, 2022
@nichoth
Copy link
Contributor Author

nichoth commented Feb 2, 2022

How to test?

  • need a second sbot running locally -- see https://github.com/ssb-ngi-pointer/netsim
  • connect the second sbot to the first
  • second sbot should have message that reference blobs that it has in its blobstore
  • first sbot replicates messages from sbot2. I think this means adding sbot2 as a friend

@nichoth nichoth moved this from In Progress to This Sprint in Planetary Webapp & Viewer Feb 2, 2022
@nichoth nichoth moved this from This Sprint to Backlog in Planetary Webapp & Viewer Feb 5, 2022
@setch-l setch-l changed the title Blobs Blobs: Request blobs that have been mentioned in a post and store them Feb 18, 2022
@setch-l setch-l changed the title Blobs: Request blobs that have been mentioned in a post and store them Blob work: Request blobs that have been mentioned in a post and store them Feb 18, 2022
@rabble rabble assigned rabble and unassigned nichoth Apr 5, 2022
@chereseeriepa chereseeriepa assigned mixmix and chereseeriepa and unassigned rabble Oct 18, 2022
@chereseeriepa chereseeriepa moved this from Backlog to Blocked in Planetary Webapp & Viewer Nov 22, 2022
@chereseeriepa chereseeriepa moved this from Blocked to Backlog in Planetary Webapp & Viewer Nov 22, 2022
@chereseeriepa chereseeriepa moved this from Backlog to GraphQL Backlog in Planetary Webapp & Viewer Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: GraphQL Backlog
Development

No branches or pull requests

4 participants