-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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] add endpoint to check notifications [Extend #9488] #9595
Conversation
Codecov Report
@@ Coverage Diff @@
## master #9595 +/- ##
==========================================
+ Coverage 42.3% 42.33% +0.03%
==========================================
Files 599 600 +1
Lines 78330 78357 +27
==========================================
+ Hits 33135 33170 +35
+ Misses 41140 41129 -11
- Partials 4055 4058 +3
Continue to review full report at Codecov.
|
06b824f
to
98719ff
Compare
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.
Would it be possible to make it return the number of unread notifications or do you think that would be slower?
since github doesnt have souch an endpoint it's gitea-definde :) @zeripath: I can send a simple json struct |
f0380bb
to
5299525
Compare
That would do - my reasoning is that this might be a useful thing for us to query instead of rendering the number of notifications directly on the server. |
|
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.
I will not block but I feel that 302 found (even more with json content) is not the best response code compared to what is defined in the RFC. I will try to have a look later if merged.
6.4.3. 302 Found
The 302 (Found) status code indicates that the target resource
resides temporarily under a different URI. Since the redirection
might be altered on occasion, the client ought to continue to use the
effective request URI for future requests.
The server SHOULD generate a Location header field in the response
containing a URI reference for the different URI. The user agent MAY
use the Location field value for automatic redirection. The server's
response payload usually contains a short hypertext note with a
hyperlink to the different URI(s).
Note: For historical reasons, a user agent MAY change the request
method from POST to GET for the subsequent request. If this
behavior is undesired, the 307 (Temporary Redirect) status code
can be used instead.
@sapk 302s Name was to good to be true for my intention ... the meaning was different :/ ... so 200 and 204 are totaly ok 👍 |
CI failed because swagger order the http response and now 200 is on top of 204. |
I'm now on my PC I'll patch this localy ... |
2d6b807
to
c5cb836
Compare
@sapk done |
ready to merge 🚀 |
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.
Just to make all checks green
extend #9488
an endpoint wich e.g. mobile clients can use to check if news are available (use less bandwith than any other notification endpoint ...)
->
GET /notifications/new