vipickering/mastr-cntrl

Double webmention bug/Missing Webmentions

vipickering opened this issue · 4 comments

Posting on swarm and backfeeding is suddenly resulting in occasional double posting of webmentions or dropped mentions

I have also spotted a failed attempt to update the webmention.json file.

Add some extra logging around all webmention functionality and track behaviour to analyse why this is happening.

The failed update to the webmention.js file is because the async process results in a race condition.
if 2 webmentions are submitted (eg from a swarm) they both try to update the file at the same time and fail.

Expanding on above.

When webmention.io sends the Webmentions to Mastr Cntrl; The promise function performs a GET on the file, to get its current GIT status. Because the promise moves on and doesn't queue up the requests what actually can happen is that two requests GET the same position, but in the time one of the requests updates the file (and changes the position) the second tries to update, sees the position is now different and the request is rejected.

I either need to:

  • Queue up the requests somehow.
  • Make each Webmention a separate file (sidestepping the issue).

I have successfully split up webmentions in to separate files and the service will loop through them and add correctly.

I am now testing they are created correctly via Mastr Cntrl.

Fixed. Testing is working perfectly