migrate to conversation API (replaces "direct" timeline) #470
No reviewers
Labels
No labels
a11y
Bug
Bug fix
cannot reproduce
CSS
Documentation
enhancement
Feature
Feature request
Held for next release cycle
Minor change
performance
priority: critical
priority: high
priority: low
priority: medium
priority: patch welcome
regression
Translation/Locale
WIP
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
AkkomaGang/akkoma-fe!470
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "Oneric/akkoma-fe:conversations-api"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The "direct" timeline is a poor interface since it mixes different DM threads together and has been deprecated for ages. The newer conversation API improves on this by offering a separate TL for each conversation and an overview over all active conversations and whether they’ve been read yet.
Example image of the overview list in the current draft:

Since we plan to soon drop
api/v1/timelines/directfrom the backend (as it will be the only remaining users of the known-buggy visibility index; by extension this TL itself is buggy too under the wrong circumstances), this immediately drops the legacy interface from the frontend too rather than offering both for a while.As it turns out though, while we long supported the conversations API, it is a bit buggy in the backend so we’ll have to fix this too. Potentially also add some more small extensions to make it more convenient.
Remaining tasks
Frontend (this PR)
(manually controlling the set of core particpants is a pre-exsiting, intentional *oma extension; Mastodon changes it automatically based on who’s addressed in the last(?)/all(?)/any(?) message)
This total count is returned when fetching ones own account as
pleroma.unread_conversation_countBackend (AkkomaGang/akkoma#1039)
with_mutedin conversation timelinePATCH /api/v1/pleroma/conversation, not just query parameters(getting it to work with current backend versions necessitated fixing the FEs handling of arrays in query parameter encoding)
last_statusof it. Currently only replies / new posts to the conversations auto-marks it as read, but going to the conv list and marking stuff as read manually if there’s nothing to reply with is a bit cumbersome and fav/reacts are a clear "read" indicatorAfter some testing, there are indeedsome unecessary preloads we can get rid of which speed things up measurably, but it remains sluggish. A
Repo.checkoutdid not significantly improve things further. From manually running the operation in a console and watching the flood of queries (presuming the logging in itself didn’t skew the relative time consumption too much) it seems the most costly part is, even with a pres-sorted index, fetching and rendering the statuses per conversation. Each call tofetch_context_queryre-queries a bunch of additional info like mutes, followers, filters, etc of the current user, before then making the query against the context index. De- and serializing this back and forth between the db and elixir comes with more overhead beyond the query times themselves.Extensions? (and related)
(the won’t necessarily all be implemented, or even if not necessarily as part of this initial PR but I’m throwing any idea which seems interesting enough out here for discussion)
pleroma.participantsas the docs used to claim was already case (it wasn’t and we recently dropped the mention of it from docs)This currently uses "Conversation ${id}" for the display title, which is kinda meh. Husky uses a list of all participants but that’s also not great and scales poorly for many participants. Being able to name long-lived conversations might be neat and easy to implement
context_ofparameter to status creation, which copies the context of the given status ID for the new root status (parameter should be ignored for replies or cause an error)We already have explicit addressing; together this would allow showing a compose box at the top of the conversation to add a new message without having to reply to a particular pre-existing post (and without needing to
@all participants)This can in principle also be used for regular, public threads if anyone finds that useful.
toto being additive rather than completely replacing addressing via in-line mentionsWould be convenient to explicitly add a non-core-participant to a subthread without needing to manually add all core-participants too
6ab6d71b32to7a16cf2d587a16cf2d587a913f50d1WIP: migrate to conversation API (replaces "direct" timeline)to migrate to conversation API (replaces "direct" timeline)All frontends TODOs are dealt with and it is already (mostly) usable. Remaining (known) issues are backend bugs (or future™ frontend changes depending on not yet existing backend API extensions)
AS a bonus this now also automatically updates the pending follow request count shown in the sidebar (without needing a page reload as was the case up until now)
687461a94c053142079705314207979b45a382b0