microdotblog / microblog-react

MIT License
30 stars 3 forks source link

`mp-syndicate-to` not sent in post create request #89

Open paulrobertlloyd opened 2 months ago

paulrobertlloyd commented 2 months ago

Posting from Micro.blog iOS 3.3 (319), the following values were present in the request (with syndication targets selected in settings screen):

{
  h: 'entry',
  content: 'Test from Micro.blog iOS 3.3 (319)',
  'post-status': 'published',
  'mp-destination': 'https://indiekit-sandbox.netlify.app'/
}

mp-syndicate-to is not present in the request.

Testing posting to the same endpoint from Quill, with syndication targets selected, the following values were present:

{
  h: 'entry',
  access_token: 'XXXXXX',
  content: 'Test from Quill',
  'mp-syndicate-to': [
    'https://web.archive.org/',
    'https://mastodon.social/@indiekit_sandbox'
  ]
}
manton commented 2 months ago

Reviewing the code, I think this is the problem:

self.post_syndicates.length === self.selected_service.active_destination()?.syndicates?.length ? null : self.post_syndicates

When we added syndication targets to Micro.blog, it created an issue for older clients that didn't support them. As a work-around, if all of the targets are selected, we don't send them, and Micro.blog assumes you want it cross-posted everywhere by default.

Another way to think about it is that Micro.blog's targets are opt-out, not opt-in.

This doesn't exactly follow Micropub, though. Before I change it, does this explain what you're seeing?

paulrobertlloyd commented 2 months ago

Ah yes, if I only check one target, mp-syndicate-to gets added which is yes, unexpected (and also reveals another bug, which I’ll create a separate PR for).

Also worth pointing to #87, in that I have my Micropub endpoint to have only one target checked, but that preference is currently not respected.