[Feature Request] API Hook for Date/Time Interval Retrieval of Messages
メンテナーはふだん 2 日以内に返信
評価
この issue はまだ評価されていません。
説明
Hi!
I am one of the developers working on Winify, a graphical UI client for Windows and one of the features that we implement is the retrieval of past notifications between a certain time-interval.
The problem is that there is no direct API hook to do that directly via Gotify. What we do instead is use the /application/{Id}/message REST path and recursively retrieve all the messages by using the Gotify pagination. After that, we sort all the messages and only then apply the user-requested date-range filter. I am unaware of any correlation between the since parameter and the actual date when the notification was sent, is there a correlation?
As you can imagine, if the Gotify server has been running for a while, retrieving all the messages or going through all the messages just to find a date-range is a miserable experience for the user, let alone the fact that loading the messages just means more a/deallocations producing memory spikes unnecessarily (this is something that we can optimize on our end, but not the time it takes to retrieve them all).
Would it be possible for you to add a hook for the API that would allow the retrieval of messages from a given application by applying a date-time filter? Right now there is:
/application/{Id}/message
so maybe something like:
/application/{Id}/message/{date}
or part of the rest of the other parameters
/application/{Id}/message?date=...
By implementing this, time to the amount of linear time complexity O(a * m) where a would be the number of applications and m would be the number of messages could just be reduced to O(a). In case the application ID is known, which in many cases it is because the option in our software is usually provided from the UI to select an application, then the whole O(a *m) is reduced to just a single operation O(1) which is an amazing performance boost at no cost.
I have not looked into Gotify myself, so I do not know the internals and I haven't dabbled in Go yet but the actual date when a notification arrives is already recorded by Gotify internally as part of the message structure such that it should not be too costly. We also filter by other criteria when searching, but that criteria is not to be found in your Gotify message structure so that would be more difficult.
Feature request #376 seems somewhat related given that a notification typically has a very short lifespan because it is supposed to notify the user what happened "now" contrasted to say a database that can hold long-term data. However, at the same time, browsing through age-old notifications like "outdoor lights went on" that took place a month ago seems irrelevant. Pagination is great for an UI when a user can click inputs and browse pages of data arranged such that not too many appear at the same time, but when you are accessing Gotify programmatically like from Winify, pagination can take a huge time and makes a bunch of useless requests.
Could you please implement this REST API path?
Thank you!
- 主要言語
- Go
- スター
- 16.1k
- フォーク
- 894
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 6
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
gotify/server のほかの issue
-
WebUI sends duplicate DELETE /message/{id} when leaving the page with pending deletes対応中かも @shivampwm2020 が 1 日前に担当しました。 オープンa:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
gotify/server#1068 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Session elevation duration is unbounded, and large values silently overflow to a past timestamp対応中かも @piyush295 が 17 日前に担当しました。 オープンa:bug
難易度 3/5 1〜2日 初心者へのやさしさ 78/100
gotify/server#1051 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
a:bug
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
gotify/server#1047 · コメント 6 件 ·
メンテナーはふだん 2 日以内に返信
-
a:feature
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
-
a:feature
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
メンテナーはふだん 2 日以内に返信
似ている issue
-
copilot-api domain:platform go
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
docs: clarify gh api -f vs -F and @-file expansion in the gh skill対応中かも @MatiasOlivera が今日担当しました。 オープンenhancement
難易度 2/5 半日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
aws/aws-advanced-go-wrapper#612 ·
-
Say in the changelog that the text-index update cannot be rolled back対応中かも @praetorianer777 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
praetorianer777/GoTome#275 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
SAP/crossplane-provider-btp#1118 ·
メンテナーはふだん 1 日以内に返信