-
Notifications
You must be signed in to change notification settings - Fork 40
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
API: No way to retrieve events later than a certain point #405
Comments
Reading this I assume you intend to store the activities locally in the clients and want to check in a given interval for new activities - right? So basically this would be an activity sync mechanism. |
Don't really care too much, which route we go. Either OCS or WebDAV OCS has the pro that it exists already, con it needs to be adjusted a lot to allow starting by timestamp and more, so we either break the existing endpoint or need to make a new one, so the already-existing benefit is gone. Anyone with power please make the call. |
Protocol is to be choosen at a later stage - for now I want to understand the client's expectations and it's operations. |
I was thinking about this:
But maybe I misunderstood the API completely? |
Well the current API is like a paged search. Just like you would get from a book or in the web ui. |
@nickvergessen OCS please. Let's stay at the current route with the current API unless a change is absolutely necessary. |
Endpoint
Questions
Request for all activities
With type filter
Parameters
Status
HeadersLink for the next requestAlready includes all parameters
First known activityIn case the
Activity element
In case the endpoint returns more fields, they should be ignored and are deprecated (only for backwards compatibility usage) or internal. Example {
"activity_id": 1,
"timestamp": 1446137950,
"app": "files",
"type": "file_deleted",
"user": "admin",
"affecteduser": "admin",
"subject": "deleted_self",
"subjectparams": [
{
"value": "\/welcome.txt",
"type": "file"
}
],
"message": "",
"messageparams": [
],
"link": "",
"object_type": "files",
"object_id": 3,
"object_name": "\/welcome.txt",
"subjectformatted": {
"trimmed": "You deleted welcome.txt",
"full": "You deleted path/to/file/welcome.txt",
"markup": {
"trimmed": "You deleted <a class=\"filename\" href=\"\/ownCloud\/master\/core\/index.php\/apps\/files?dir=%2F&scrollto=welcome.txt.d1446137950&view=trashbin\" title="in path/to/file">welcome.txt<\/a>",
"full": "You deleted <a class=\"filename\" href=\"\/ownCloud\/master\/core\/index.php\/apps\/files?dir=%2F&scrollto=welcome.txt.d1446137950&view=trashbin\"path/to/file/>welcome.txt<\/a>"
}
},
"messageformatted": {
"trimmed": "",
"full": "",
"markup": {
"trimmed": "",
"full": ""
}
}
} Usages
NotesThe endpoint does not yet output that information |
THX @nickvergessen We need to specify the url parameters of the request as well. May I suggest to add some example code like https://developer.github.com/v3/repos/#get ? THX |
Updated |
Nice, this looks reasonable. Some questions/remarks:
|
this approach follows a common standard - https://tools.ietf.org/html/rfc5988 - used by e.g. Github as well |
Accept is to specify the full body format - not individual elements |
Missed it, added now:
Well then we need to wrap the result once more, because stuff can not be added to the meta setion, resulting in:
As per description above:
Not possible, because the header is used by OCS to decide if json or xml is to be returned.
No, only in some cases. When stuff is grouped (instead of a single activity) or when there are more parameters, they are not equal anymore. But yes, object_id will most likely be added to the path for future activities |
@DeepDiver1975 @nickvergessen ok, how do we resolve the problem with the mark-up cluttering? We do not want to add mark ups for all use cases (webIF, RSS, desktop, mobile, no idea..), see that for example the css class-definitions do not make sense for clients. How about a reduced "meta markup" - maybe rst-based - that needs to be converted to the final on each client? |
Well that is why we have versions completly without markup: "subjectformatted": {
"trimmed": "You deleted welcome.txt",
"full": "You deleted path/to/file/welcome.txt", But I see that you don't really want to have that either. I mean we can do something like Grouping could be an collection item: Would work for me. Is that would you had in mind? |
Well, no markup at all is not useful as well. I like @nickvergessen idea of the simplified markup. However, the solution should completely preserve the translation, otherwise the texts become completely useless. Another alternative would be to add a parameter to the request which markups should be added, ie. |
I mean we do that indirectly atm anyway (that's how we ended up with those options (full path, html, grouping, ...) |
@nickvergessen lets keep it simple for now:
I do not really see the need for the collection thing you mentioned. What do I overlook? |
We have "other" parameters as well, like calendar names, federated cloud ids, for the sake of sanity I'd just put them into tags as well, define a list somewhere and you can just strip them out if you feel like it. |
Merged #434 |
The API turns out to not be suitable to fulfill the needs of WebUI and client. That is for the following reasons:
@nickvergessen saw more issues. Unfortunately the required changes can not go into 9.0 any more. |
Argh. @nickvergessen @dragotin Not sure how this happened. Any suggestions how we can fi this mess? |
Well we need this scheduled in the same time frame as the client so we can work on it concurrently. Most likely we have to break the activity manager api, as it currently allows for random output, even html works. We need to define a structure that works for more api users than just the web ui and then all activity creating apps need to obey this new format. We also need to define what we do with objects we don't know, so objects should come with a type and id additional to the name, but in a defined format. When the api consumer then does not know the type it simply strips out the tag and only retains the name and the result should be usable, that's what I understood from Klaas' request? |
does 9.0.1 work? |
This sounds like more changes are needed then just a bugfix. So 9.1 it seems. :-( Again. Not sure how this disconnect could have happened on the architecture side. @nickvergessen @DeepDiver1975 Can you please schedule a call with me to discuss a possible way out? Thanks. |
@karlitschek so the original v2 OCS API was removed from the public api. So no unused API will be released - which is good. I suggest we discuss the API to be used from 9.1 on during the design week in Nürnberg - with @dragotin being there as well we can get this sorted out. |
agreed. let restart this for 9.1 |
@karlitschek mentioned something about a public standard that could be used here. |
In the interim between 9 and 9.1, a draft standard from W3C emerged. There is the opportunity to use this standard for this activity stream, rather than implementing our own. As it is in draft, we can put in feature requests. Plan for oC
Any other W3C API specification support is for a version 2.0. |
Estimation: 2 weeks |
The current API only takes the parameters
page number
andnumber of entries
to influence the subset of entries returned.For a client that is not suitable. We need an API that provides all new entries that came after a certain point of time. That can either be done through ID or timestamp. The client needs a way to specify a number of events to be returned at a time (already there), but also a way to query how many new entries are new after a certain point.
This blocks owncloud/client#3732, owncloud/client#3728
The text was updated successfully, but these errors were encountered: