[Feature Request] API Hook for Date/Time Interval Retrieval of Messages
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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!
- Ngôn ngữ chính
- Go
- Star
- 16k
- Fork
- 891
- Merge trung bình
- 2 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của gotify/server
-
a:bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
gotify/server#1068 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Session elevation duration is unbounded, and large values silently overflow to a past timestampCó thể đã có người làm @piyush295 đã nhận 14 ngày trước. Đang mởa:bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
gotify/server#1051 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
a:bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
gotify/server#1047 · 6 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
a:feature
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
-
OIDC: Disallow changing admin permissions for oidc users when OIDC group mapping is configuredĐang mởa:feature
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của gotify/server
Issue tương tự
-
darwin zsh
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
carapace-sh/carapace-bin#3846 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
appplication - is a typo?Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 70/100
golang-app/ecommerce#179 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Simulator process crashes (nil pointer panic) when the dataset returns an errorCó thể đã có người làm @EugeneVon đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
llm-d/llm-d-inference-sim#772 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
refactor: decode numchildren with a lenient int type instead of a hand-written xProp.UnmarshalXMLĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
crazy-goat/xdbg#125 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
150 points ci complexity:medium drips-wave help wanted medium
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sorotrail/SoroBeacon#449 ·
Maintainer thường phản hồi trong vòng 1 ngày