Open-Assistant icon indicating copy to clipboard operation
Open-Assistant copied to clipboard

Create UI for messages API endpoints (user + global message-tree views)

Open andreaskoepf opened this issue 2 years ago • 1 comments
trafficstars

Backend message API endpoints are now available (see your local docs while the backend is runnnig): /messages: by global message id (uuid) /users/{user_id}/messages: by global user id (uuid) /frontend_messages: by frontend message id /frontend_users/{username}/messages: by frontend user name (auth_method will be added here)

Several query options are available.

We want to offer the following views:

  1. allow users to view specifically messages they submitted
  2. offer inspection for all messages in the system

There are potentially MANY messages in the system, therefore we primarily select by date range or username prefix, e.g. to page through /messages endpoint:

  1. user selects a base date (or begin of messages) + limit (max 1000) messages to retrieve + only_roots bool (optional)
  2. if user clicks next send a new query with base date set to the created_date of the last message received by the previous call (date is currently missing in the messages model, will be added soon)

As soon as a single message is selected the corresponding conversation or message tree can be retrieved, e.g.:

  • /api/v1/messages/{message_id}/tree
  • /api/v1/messages/{message_id}/conversation

There are additional endpoints to select the longest conversation in a tree (/api/v1/messages/{message_id}/longest_conversation_in_tree) and the message with the most children.

@fozziethebeat will generate additional issues for this (and other admin interface parts).

andreaskoepf avatar Dec 31 '22 10:12 andreaskoepf

I'll probably turn this into a milestone and a variety of more specific feature request issues.

Still drafting what that will all look like.

fozziethebeat avatar Jan 01 '23 03:01 fozziethebeat

I'm marking this as documentation and closing it. I've created a milestone regarding messages and broke this down in to three smaller issues. There's likely more to add in as we explore.

fozziethebeat avatar Jan 03 '23 06:01 fozziethebeat