Today, for the first time in a long while, I'm able to carve out a whole day to work on #Macstodon . So like I did a few weeks back, this is going to be a "live" thread of my attempt to get bookmarks, boosts, and favourites implemented. Maybe replies too, if there's time. Maybe other things if it goes really well and there's lots of time.

#RetroProgramming

First of all, I just fixed the bug that allowed you to have multiple toots selected at once, across different timelines. That's kind of an important one because we need to know _which_ toot is selected in order to interact with it!

I _almost_ have bookmarks working. I wrote a helper function to find the selected toot and timeline that it belongs to, extract the ID, figure out if it's already been bookmarked or not, and make the appropriate API call.

For some reason the HTTP request is failing though, and I'm getting a generic "malformed URL" error, even though the URL is definitely correct, and other requests seem to work just fine. 😕​

OK, fixed it! I wasn't handling the case properly when POSTing to a URL with an empty post body. But it works, and now I can successfully bookmark a toot from within Macstodon 😁​

Unbookmarking doesn't work though - and I think I know why, it's because the previous state of the toot is cached in the timeline. So we don't know that the toot has _already_ been bookmarked, and that we need to unbookmark it instead. Shouldn't be too hard of a fix though.

why is caching so hard ugh
@smallsco I consider caching to be a last resort rather than my first go to. Sensible algorithms is my go to, optimizing my fallback.