-
Notifications
You must be signed in to change notification settings - Fork 14
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
Apiv2 #153
base: master
Are you sure you want to change the base?
Apiv2 #153
Conversation
Codecov Report
@@ Coverage Diff @@
## master #153 +/- ##
===========================================
+ Coverage 91.73% 93.54% +1.8%
- Complexity 129 167 +38
===========================================
Files 17 18 +1
Lines 569 759 +190
===========================================
+ Hits 522 710 +188
- Misses 47 49 +2
Continue to review full report at Codecov.
|
I don't get the neccessity of this new api. Desktop, mobile and web clients can/should use the same APIs in any case - otherwise we are doing it really wrong - and do not believe this. |
Current API is very inneficient in terms of polling. It basically fetch all the notifications for the user regardless of the situation.
As said, the new API solves these problems:
From a UX point of view, the PR moves from a "you have to attend the notifications as fast as you can" due to a heavy network usage otherwise, to a "you have notifications, attend them when you want". |
these query parameters exist on the v1 api? We can adopt them in the UI client side as needed. Thanks for having a look at this issues. Can we see if this can be done without introducing v2? Please give it a try. THX |
It doesn't look good. I'm not sure who is actively using that etag, but unless we remove it I don't think we can bring any improvement there, it's completely pointless. The problem is that this might break the service specification, so It doesn't seems we can remove it. Even if we change the implementation of the etag generation to provide a better and less buggy one, the effect is that we won't be checking if there are changes, we'll be fetching the changes, so providing an etag there is completely useless, unless we provide another more efficient endpoint to check for changes. To sum up the changes I see:
Note that the new v2 uses plain JSON, not OCS. This also reduces the network overhead that comes with the continous polling. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this is a big loss of UX, in return for 1.2k LOC, and in order to solve a theoretical problem. Do we have any cases where this is actually a performance issue?
A change in the behaviour doesn't necessarily means a loss of UX.
It's possible to keep the current behaviour, although the code will be more complex, that's why I'd prefer to keep this new behaviour.
There won't be any report unless the request takes more than 1 minute or 1 minute and a half, and that would be due to the maximum limit of parallel ajax requests in the browser, which would affect to other ajax requests that would need to be queued and delayed, making the problem visible for the user. This is really unlikely even in the worst scenario. |
anything which is meant to be a public api has to be either WebDAV or OCS. No other concept is allowed - even if we don't like it. |
is available for the user
While playing with the current notifications api in the scope of phoenix I have to agree that v1 is far from optimal. What we basically want to do is syncing the notifications. We might want to research into implementing the notifications collection as synced dav collection ... |
New notification API, being used by the webUI already. The old API is still available mainly for the desktop client.
New API focuses on efficient network usage specially if the user has several notifications pending, as well as long lists of notifications.
As part of the API changes, the usage of the web browser notification has changed, showing only the browser notification only once until further interaction with the ownCloud's notifications has been made. Once you "know" you have pending notifications, the browser won't bother you until you fetch all of pending notifications.
Note that the notification permission will be requested on page loading (when the component is being initialized) instead of when a new notification arrives. This might be a bit problematic on some scenarios if the browser permission hasn't been accepted or rejected beforehand.