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

Support Salmentions #21

7 of 18 tasks
voxpelli opened this issue Aug 24, 2015 · 1 comment
7 of 18 tasks

Support Salmentions #21

voxpelli opened this issue Aug 24, 2015 · 1 comment


Copy link

With #18 fixed and the comments now being curlable the next step would be to utilize that curlability by becoming part of the salmentions ecosystem and both receive salmentions from others and forward them.

This moves this endpoint closer to be able to take part in a SWAT0 dance.

  • Fetch the WebMention pinged target site if it isn't already in the database and store it in entries and especially ensure to save its interaction targets
  • Fetch all the interaction targets found that isn't already in the database and extract their WebMention endpoints. Save these as entries just like all other entries?
  • Parse the comments included in the WebMention pinged source
  • Fetch each found comment that isn't already in the database and save them as entries and mentions. If they are not targeted at a registered site, then maybe mark them as "external" or something
  • Present the full comment tree – mentions of mentions of mentions – at least in the embed type created in Provide a non-js fallback – make curlable #18 and especially on the standalone page
  • Ensure that a too deep comment tree doesn't break presentation – look at how eg. Disqus does it – after X many levels don't indent the additional levels anymore. This is a pure styling issue.
  • Whenever all comments has been fetched, if any new were found – send a WebMention to each interaction target of the original WebMention pinged target
  • Ensure that if an earlier post updates to mention a post later in the chain that no infinite salmentioning will happen – this is probably more of a problem in the presentation part than in the pinging part. If the relation gets circular then any attempt at trying to fetch a tree representation of that relation will be infinitely deep. A graph database would really make sense here – fetching an entire tree in PostgreSQL isn't really that optimal – one would really need one JOIN per level
  • Make it opt-in? So only those using the embed from Provide a non-js fallback – make curlable #18 actually get Salmentions sent as the rest won't support it anyway?
  • Ping person-tags – important – critical part of SWAT0
  • Ensure pings are only sent on updates and try to avoid getting into a circular pinging exercise where you ping others and therefore they ping you, so therefore you ping them again and so on
  • Ensure pings are only sent when the data presented on the u-responses page has changed – we should not ping when the receiver has no way of detecting any actual change
  • Do some caching – don't refetch everything always
  • On an update: Diff the content and only ping and refetch what has actually changed – true especially for comments
  • Add support for if-modified-since and etag to check for fresh content
  • Update the js-embed to also show the full comment tree
  • Add a way to actually opt-in in the UI – and require IndieAuthing (related to Add IndieAuth as an authentication mechanism #30) with the domain to verify ownership or something before allowing it
  • Support sending Salmentions for non-interactions, for the mentions, without pinging hundreds of URL:s – a tricky one

So this more or less means that rather than just simply fetching a single page, the source, per WebMention the script would, in the worst case scenario, have to fetch four different types of pages: The source, the target, all comments included in the source and all targets of the target.

And when all that is done it has to send WebMentions to all the WebMentions endpoints of the targets targets.

So a source with a single comment on a target with a single target would mean fetching 4 pages and doing 1 WebMention rather than just fetching 1 page as is done today. And 4 times the metadata will be stored. This metadata will be possible to use to better present reply-context and such on eg. the standalone embed pages and such though and could perhaps be used in other ways as well.

Copy link
Owner Author

voxpelli commented Sep 6, 2015

A first full implementation, with tests, of Salmentioning – fetching and sending – is now in master.

It still does some excessive fetching and pinging and it is possible for it to get stuck in an infinite loop – and there's yet no way to opt-in a site through the UI – but the basis is there and it works – now it's just a matter of refining it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

1 participant