Pixelfed: API created odd missing/broken post

Created on 16 Apr 2020  路  4Comments  路  Source: pixelfed/pixelfed

hi all! i used the API to create a post just now, via /api/v1/media and /api/v1/statuses on https://piconic.co/ (0.10.8). both API requests succeeded, but the post itself doesn't show up on my profile https://piconic.co/snarfed , and the post's permalink URL https://piconic.co/p/snarfed/156271590181572608 gives the error _Oops! An error occured, please try refreshing the page._

here are the requests i made and their responses. hope this helps!

POST https://piconic.co/api/v1/media
MIME multipart with one file, contents: https://snarfed.org/1965_mustang.jpg

response:

{
  "id": "1209",
  "type": "image",
  "url": "https://piconic.co/storage/no-preview.png",
  "remote_url": null,
  "preview_url": "https://piconic.co/storage/no-preview.png",
  "text_url": null,
  "meta": null,
  "description": null
}

POST https://piconic.co/api/v1/statuses
request body:

{
  "status": "This is a picture. (http://localhost/photo.html)",
  "media_ids": ["1209"]
}

response:

{
  "id": "156271590181572608",
  "uri": "https://piconic.co/p/snarfed/156271590181572608",
  "url": "https://piconic.co/p/snarfed/156271590181572608",
  "in_reply_to_id": null,
  "in_reply_to_account_id": null,
  "reblog": null,
  "content": "This is a picture. (http://localhost/photo.html)",
  "created_at": "2020-04-16T05:27:30.000000Z",
  "emojis": [],
  "replies_count": 0,
  "reblogs_count": 0,
  "favourites_count": 0,
  "reblogged": null,
  "favourited": null,
  "muted": null,
  "sensitive": false,
  "spoiler_text": "",
  "visibility": null,
  "mentions": [],
  "tags": [],
  "card": null,
  "poll": null,
  "application": {
    "name": "web",
    "website": null
  },
  "language": null,
  "pinned": null,
  "account": {
    "id": "145384761425268736",
    "username": "snarfed",
    "acct": "snarfed",
    "display_name": "Ryan",
    "locked": false,
    "created_at": "2020-03-17T04:27:08.000000Z",
    "followers_count": 0,
    "following_count": 0,
    "statuses_count": 1,
    "note": "",
    "url": "https://piconic.co/snarfed",
    "avatar": "https://piconic.co/storage/avatars/014/538/476/142/526/873/6/mo4Ek03zG0hNFD7jCRox_avatar.jpeg?v=d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35",
    "avatar_static": "https://piconic.co/storage/avatars/014/538/476/142/526/873/6/mo4Ek03zG0hNFD7jCRox_avatar.jpeg?v=d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35",
    "header": "",
    "header_static": "",
    "emojis": [],
    "moved": null,
    "fields": null,
    "bot": false,
    "software": "pixelfed",
    "is_admin": false
  },
  "media_attachments": [{
    "id": "1209",
    "type": "image",
    "url": "https://piconic.co/storage/m/d0931bf747b992a1c83e055753526516f2706111/dba50196c663d6913eb704cd7f6be7d16ca5aa5d/RuNfohQPgxy9ocqEZ48GsQQtWsUY8XqGs5zdtyhJ.jpeg",
    "remote_url": null,
    "preview_url": "https://piconic.co/storage/no-preview.png",
    "text_url": null,
    "meta": null,
    "description": null
  }]
}
馃悰 Bug 馃攦 API

All 4 comments

I have reproduced the bug, the visibility is not being set properly. Working on a fix!

thanks! will the fix also apply to shares? i tried creating a share via the API, and the same thing happened: API request succeeded, but the shared post isn't visible on my profile. or is it not supposed to be?

POST https://piconic.co/api/v1/statuses/156164634783649792/reblog
response body:

{
  "id":"156164634783649792",
  "uri":"https://piconic.co/p/sturmen/156164634783649792",
  "url":"https://piconic.co/p/sturmen/156164634783649792",
  "in_reply_to_id":null,
  "in_reply_to_account_id":null,
  "reblog":null,
  "content":"...",
  "created_at":"2020-04-15T22:22:30.000000Z",
  "emojis":[

  ],
  "replies_count":0,
  "reblogs_count":6,
  "favourites_count":8,
  "reblogged":null,
  "favourited":null,
  "muted":null,
  "sensitive":false,
  "spoiler_text":"",
  "visibility":"public",
  "mentions":[

  ],
  "tags":["..."],
  "card":null,
  "poll":null,
  "application":{
    "name":"web",
    "website":null
  },
  "language":null,
  "pinned":null,
  "account":{
    "id":"121262268343259136",
    "username":"sturmen",
    "acct":"sturmen",
    "display_name":"Nicholas Tinsley",
    "locked":false,
    "created_at":"2020-01-10T14:52:57.000000Z",
    "followers_count":47,
    "following_count":1,
    "statuses_count":96,
    "note":"Professional programmer, hobbyist photographer.",
    "url":"https://piconic.co/sturmen",
    "avatar":"https://piconic.co/storage/avatars/012/126/226/834/325/913/6/bivWclAi9wWjTKmOHUBv_avatar.jpeg?v=d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35",
    "avatar_static":"https://piconic.co/storage/avatars/012/126/226/834/325/913/6/bivWclAi9wWjTKmOHUBv_avatar.jpeg?v=d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35",
    "header":"",
    "header_static":"",
    "emojis":[

    ],
    "moved":null,
    "fields":null,
    "bot":false,
    "software":"pixelfed",
    "is_admin":false
  },
  "media_attachments":[{
    "id":"1208",
    "type":"image",
    "url":"https://piconic.co/storage/m/d0931bf747b992a1c83e055753526516f2706111/fd96146a05926d57f3216dff0d2808668bcb7ca3/CHO2eWYKOwRsbeamDG8VNUCrKNi5JMvqsTCC1XO8.jpeg",
    "remote_url":null,
    "preview_url":"https://piconic.co/storage/m/d0931bf747b992a1c83e055753526516f2706111/fd96146a05926d57f3216dff0d2808668bcb7ca3/CHO2eWYKOwRsbeamDG8VNUCrKNi5JMvqsTCC1XO8_thumb.jpeg",
    "text_url":null,
    "meta":null,
    "description":null
  }],
  "type":"repost"
}

@snarfed Yes, both issues are fixed in 324ccd0

confirmed for creating new posts! reposts still aren't working though. i get a 201 back with the original post's AS2 object, but it doesn't show up on my profile. it also doesn't increment the post count on my profile, so i expect now the problem may be different than visibility.

example:

INFO:root:requests.post https://piconic.co/api/v1/statuses/153490526442754048/reblog {'headers': {'Authorization': '...'}}
INFO:root:Returning {
  "id":"153490526442754048",
  "created_at":"2020-04-08T13:16:33.000000Z",
  "in_reply_to_id":null,
  "in_reply_to_account_id":null,
  "sensitive":false,
  "spoiler_text":"",
  "visibility":"public",
  "language":"en",
  "uri":"https://piconic.co/p/sturmen/153490526442754048",
  "url":"https://piconic.co/p/sturmen/153490526442754048",
  "replies_count":0,
  "reblogs_count":5,
  "favourites_count":5,
  "reblogged":false,
  "favourited":false,
  "muted":false,
  "bookmarked":false,
  "pinned":false,
  "content":"...",
  "reblog":null,
  "application":{
    "name":"web",
    "website":null
  },
  "mentions":[],
  "tags":["..."],
  "emojis":[],
  "card":null,
  "poll":null,
  "account":{
    "id":"121262268343259136",
    "username":"sturmen",
    "acct":"sturmen",
    "display_name":"Nicholas Tinsley",
    "locked":false,
    "created_at":"2020-01-10T14:52:57.000000Z",
    "followers_count":50,
    "following_count":1,
    "statuses_count":98,
    "note":"Professional programmer, hobbyist photographer.",
    "url":"https://piconic.co/sturmen",
    "avatar":"https://piconic.co/storage/avatars/012/126/226/834/325/913/6/bivWclAi9wWjTKmOHUBv_avatar.jpeg?v=d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35",
    "avatar_static":"https://piconic.co/storage/avatars/012/126/226/834/325/913/6/bivWclAi9wWjTKmOHUBv_avatar.jpeg?v=d4735e3a265e16eee03f59718b9b5d03019c07d8b6c51f90da3a666eec13ab35",
    "header":"",
    "header_static":"",
    "emojis":[

    ],
    "moved":null,
    "fields":null,
    "bot":false,
    "software":"pixelfed",
    "is_admin":false
  },
  "media_attachments":[
    {
      "id":"1054",
      "type":"image",
      "url":"https://piconic.co/storage/m/d0931bf747b992a1c83e055753526516f2706111/fd96146a05926d57f3216dff0d2808668bcb7ca3/XFNI0J8i3Nzu8ewnoyBynwkyyiuW7jaHLAc65vOX.jpeg",
      "remote_url":null,
      "preview_url":"https://piconic.co/storage/m/d0931bf747b992a1c83e055753526516f2706111/fd96146a05926d57f3216dff0d2808668bcb7ca3/XFNI0J8i3Nzu8ewnoyBynwkyyiuW7jaHLAc65vOX_thumb.jpeg",
      "text_url":null,
      "meta":null,
      "description":null
    }
  ],
  "type":"repost"
}
Was this page helpful?
0 / 5 - 0 ratings

Related issues

Dobios picture Dobios  路  3Comments

diogogithub picture diogogithub  路  3Comments

petre2dor picture petre2dor  路  4Comments

NFGman picture NFGman  路  5Comments

efelon picture efelon  路  3Comments