-
Notifications
You must be signed in to change notification settings - Fork 35
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
Sort news/push notifications #3164
base: develop
Are you sure you want to change the base?
Conversation
Code Climate has analyzed commit afd2f3a and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (50% is the threshold). This pull request will bring the total coverage in the repository to 82.4% (0.0% change). View more on Code Climate. |
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.
Looks good 😸
@steffenkleinle FYI |
Thanks for the ping. Could we perhaps adjust the naming to I assume that the API will stay backwards compatible and keeps delivering the I think the information that there is a |
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.
Not a review, but I noticed that this change should be documented in our api documentation
Short description
News items are sent out as push notifications to subscribed devices as well as served via our API. Push notifications are saved as separate objects in our database in order to retain the information for which news items we already sent notifications and to keep that separate from the concept of the content of the news item itself.
News items have a property
last_updated
, which describes when the content was last edited. Push Notification objects have asent_date
, which describes when the notification for this news item in that channel and this language was sent out. In the API, we only exposelast_updated
, which is the value also being displayed in the app. This can cause confusion whenever the date the news item was last edited is far before the date when it was actually sent.Proposed changes
display_date
to each news item returned by the API which equals eitherlast_updated
orsent_date
of the corresponding push notification, whichever is greater (effectively clamping the value oflast_updated
to be no earlier thansent_date
)display_date
value instead oflast_updated
Side effects
last_updated
timestamp
over todisplay_date
. No further change should be required.If it aligns with how the app team handles this, Local news list sorting integreat-app#2952 might be repurposed for that request.
Resolved issues
Fixes: #2994
Pull Request Review Guidelines