-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Activity feed: JSON API #814
Comments
@augustebaum & @thomass-dev may I have your review on this ? |
I have a few questions:
|
Note: warnings are removed from this first iteration. |
Hmmm your right I forgot that. Editing... |
It could be quite easy to add warnings. [
{
"name": "High class imbalance",
"media_type": "application/vnd.warning+text",
"value": "It seems that you have a classification problem with at least one class with...",
"updated_at": "2020-07-10 15:00:00.000",
"created_at": "2020-07-10 15:00:00.000"
}
//...
] |
Does |
Can you give more details? Why is it a perfect use-case, and if so, why would we not do that? |
It's a good question. Those naming comes directly from what we have in the project API. I prefer to have consistent naming for the same thing. But you're right to have consistent data and as each item will have only one creation_date we can change the data layout to: {
"name": "High class imbalance",
"media_type": "application/vnd.warning+text",
"value": "It seems that you have a classification problem with at least one class with...",
"created_at": "2020-07-10 15:00:00.000"
} and avoid confusion.
It's an activity feed. The term feed could let you think that it's real time. Hence a real time communication protocol sounds appropriate. But to implement this without some message broker we would need to watch the db changes. As far as I know, because we use diskcache, we cant have easily access to the sqlite driver to register some hooks. As a first approach polling with incremental search will have good performances and abstracts us from complex communication between process. |
Works for me |
edit: added @augustebaum feedbacks |
Just a naive question: what about mixing history and activity? If you ask for the last 5 minutes activity, and one item has changed 2 times during this period (same identifier, two different values). Would you receive the two versions of the items? Or the latest one? Otherwise, perfect proposition, thanks @rouk1 . |
You should receive all events that happens during that time frame. Hence 2 versions of your item. |
Can you update your description that way and make a quick reference? |
Done, is it ok for you ? |
LGTM |
As a frontend developer I want to request the project's activity using an HTTP API.
Needs
We need to serialize a list of item version for the frontend to display them from most recent to oldest one.
Note
This means that: if a user asks for the last 5 minutes of activity, and one item has changed 2 times during this time frame (same identifier, two different values), they will receive 2 versions of this item.
Proposed API
GET
/api/project/activity?after={creation_datetime}
(fetch the project activity)Parameters
after
Response
200
application/json;charset=UTF-8
[{...}, {...}, ...]
create_at
datetime.Data layout
The text was updated successfully, but these errors were encountered: