-
Notifications
You must be signed in to change notification settings - Fork 638
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
Fix list activity notifications #12386
base: release-v0.17.x
Are you sure you want to change the base?
Fix list activity notifications #12386
Conversation
Build Artifacts
|
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.
A good start, but I think we can make the changeover to timestamp a bit more systematically.
One other thing that would be important to investigate in this changeover, is whether we need to add a db_index to the timestamp field: https://github.com/learningequality/kolibri/blob/develop/kolibri/core/notifications/models.py#L117 the primary key (id) is indexed by default, so querying solely by timestamp may be considerably less performant.
kolibri/plugins/coach/assets/src/modules/coachNotifications/index.js
Outdated
Show resolved
Hide resolved
@@ -154,9 +154,6 @@ | |||
const params = { | |||
...this.filterParam, | |||
}; | |||
if (this.notifications.length) { | |||
params.before = this.notifications.slice(-1)[0].id; |
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.
Why has this been removed?
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.
The before
param is already set inside the moreNotificationsForClass
action https://github.com/AlexVelezLl/kolibri/blob/cdb559e453c0c6468ef95d4c97ad7bfdb342d9ec/kolibri/plugins/coach/assets/src/modules/coachNotifications/index.js#L104. So it was repeated code and thought it was better to keep the one in the moreNotificationsForClass
action,
Summary
There have been a large number of inconsistencies between generating notifications on an original device, and creating notifications when a device is importing a facility from another device. Mainly because the notifications are not created in chronological order, but are created as the log records are imported. Which leads to the main assumption that notifications are created in a chronological order being incorrect. This PR fixes the following:
timestamp
field of thelearnerprogressnotification
table.ClassroomNotificationsFilter
class was created to update the way to filter records to use filtersets.notifications
,allNotifications
by timestamp.Answered
notifications, an empty notifications list was rendered without option for the user to see more notifications. So now we load more notifications until the user could see the latests notifications.References
Closes #11782.
Reviewer guidance
Set up a device with multiiple lessons/resources/quizes and play with it to have different types of notifications. Then import the facility to a new device and check that notificatoins match.
Testing checklist
PR process
Reviewer checklist
yarn
andpip
)