cheeaun / cheeaun/phanpy

Editing a post on Akkoma instance throws up incorrect error about polls

Open
#470 0 comments 0 reactions 0 assignees View on GitHub
bug in progress
Dominant language
JavaScript
Stars
1.5k
Forks
186
Avg merge
1d 36m
Merged PRs (30d)
11

Description

**Describe the bug**
Trying to edit a post on social.rjp.is (an Akkoma instance) gives "poll - Invalid object. Got: boolean." even though the post doesn't have a poll.

Testing a theory by hand triggers this error if the request has `"poll": false` (which is an invalid request according to my reading of https://docs.joinmastodon.org/methods/statuses/#edit anyway.)

```
{
"error": "poll - Invalid object. Got: boolean.",
"errors": [
{
"message": "Invalid object. Got: boolean",
"source": {
"pointer": "/poll"
},
"title": "Invalid value"
}
]
}
```

Probably best to not send any fields if they're not being specifically updated in the update call?

**To Reproduce**
1. Post using an Akkoma (probably also a Pleroma) instance
2. Edit the post
3. Hit "Update"

**Expected behavior**
The post should be updated.

**Screenshots**
Screenshot 2024-03-26 at 20 32 59

**Desktop**
- OS: macOS Sonoma 14.4 (23E214)
- Browser: Safari 17.4 (19618.1.15.11.12)
- Version: Phanpy 2024.03.17.c7c764a (self-hosting)

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing post editing on an Akkoma instance and inspect the update request sent when the post has no poll. Compare it with the Mastodon edit-statuses API requirements, then verify that editing succeeds without sending an invalid poll value.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.