You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The name of the parameter seems weird to me : message ids get incremented, so the message received by the server "since" a given id are those with higher numbers.
Keeping the current behavior, the parameter should be renamed "until" or "before". Better though would be to keep "since" but actually return new messages. Seems to be a more frequent use case no ?
I see.
In my case I have a client (small esp8366-based display) which polls for
new messages on regular basis, not via websocket. It has limited memory so
only keeps track of the id of the last message it saw.
Being able to get only the messages "since" that last id would be
convenient instead of working it's way back until it reaches that id.
Thanks for the reply, and the great app.
On Mon, Jun 15, 2020, 8:55 PM Jannis Mattheis ***@***.***> wrote:
@naimo <https://github.com/naimo> Naming is hard (:.
I think, I called it this way because the messages are sorted in
descending order. Thus, since kinda makes sense. The behavior is also
documented <https://gotify.net/api-docs#/message/getMessages>
Ascending:
Message 1 |- until 3
Message 2 |
Message 3
Message 4 |
Message 5 |- since 3
Descending:
Message 5 |- until 3
Message 4 |
Message 3
Message 2 |
Message 1 |- since 3
I don't think this renaming would justify a breaking API change.
Better though would be to keep "since" but actually return new messages.
Seems to be a more frequent use case no ?
It is actually not because new messages will be transmitted via web
socket. Still, the API addition would have some use cases.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#34 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABBR472OR7HUARTVDVV42BDRWZVANANCNFSM4EWJ4HPA>
.
Activity
lslah commentedon Mar 24, 2018
since=idis probably better as two messages might have the same date, see https://coderwall.com/p/lkcaag/pagination-you-re-probably-doing-it-wrongjmattheis commentedon Mar 24, 2018
@lslah Using ids for pagination seems to be better. Good point!
[#34] Adjust message api to be paged
[#34] Add db calls for paged message api
[#34] Add error messages for min and max
[#34] Update update api documentation & Increase api version
[#34] Add react-list UI dependency
[#34] Adjust action to adjusted api
[#34] Add react-list & lazy-loading to Messages & Adjust store to mak…
[#34] Add delete messages action handling
[#34] Add key to react list
[#34] Adjust message api to be paged
[#34] Add db calls for paged message api
[#34] Add error messages for min and max
[#34] Update update api documentation & Increase api version
[#34] Add react-list UI dependency
[#34] Adjust action to adjusted api
[#34] Add react-list & lazy-loading to Messages & Adjust store to mak…
[#34] Add delete messages action handling
[#34] Add key to react list
naimo commentedon Jun 15, 2020
The name of the parameter seems weird to me : message ids get incremented, so the message received by the server "since" a given id are those with higher numbers.
Keeping the current behavior, the parameter should be renamed "until" or "before". Better though would be to keep "since" but actually return new messages. Seems to be a more frequent use case no ?
jmattheis commentedon Jun 15, 2020
@naimo Naming is hard (:.
I think, I called it this way because the messages are sorted in descending order. Thus,
sincekinda makes sense. The behavior is also documentedI don't think this renaming would justify a breaking API change.
It is actually not because new messages will be transmitted via web socket. Still, the API addition would have some use cases.
naimo commentedon Jun 15, 2020
jmattheis commentedon Jun 15, 2020
@naimo Yeah, our android app does something similar. I've created #329 to add this functionality.