-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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(userstatus): Track message timestamp too #40564
Conversation
$schema = $schemaClosure(); | ||
|
||
$statusTable = $schema->getTable('user_status'); | ||
$statusTable->getColumn('status_message_timestamp')->setNotnull(true); |
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.
could skip this migration by going with default => 0
on the column
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.
🦭
Tested with my 0-PHP-knowledge, works fine for custom statuses.
Should it also work for predefined ones, like "Commuting"?
Also noted:
- upgrade to 1.8.1 works smoothly, status is saved
- downgrade to 1.8.0 breaks the instance, but that should be expected, i guess
Unfortunately yes. YOu can manually delete the column from the database table (but that will break on updating, unless you also remove the row in oc_migrations table, so I personally would prefer to reinstall) |
When selecting them I guess yes. When they fade (because clearAt was reached) and you turn into "Away/Online" I guess also yes? |
Right! Forgot to test those. When the predefined statuses are selected they should definitely update the status message timestamp. |
Going from a preset status (or custom status) to no status erases the database entry. There is no record of the change on the recent statuses widget. I would say this is the expected behavior, because there is no recent status to list. |
Right, then that's how it is |
Restoring from backup status (e.g. custom status > join a call for IN_CALL hardcoded one > leave call again) should also update the timestamp? Or not? |
Phew. It's getting complicated. If we update the status message timestamp when an automated status is entered, it should also update when that status ends and the previous status is restored from backup. Con: status shows as updated at restore when the user didn't update it themselves.
Alternatively, we can not update the timestamp for entering/leaving an automated status. Pro/con: automated statuses don't show on the recent statuses widget.
@jancborchardt are you okay with the |
Integration test suite added so we can be sure the strange edge cases all work as expected |
@Antreesy @nickvergessen if you are okay with the current solution we can integrate this (and unblock #40559). If we decide that automated/backup statuses should update the timestamp as well we can still change that behavior later on 👍 |
Agreed |
d7a5f00
to
2790602
Compare
Signed-off-by: Christoph Wurst <[email protected]>
2790602
to
fbdf733
Compare
Summary
Add new database column to track the message change date.
The fix requires a database schema change and data migration. I would vote against backporting.
How to test
master: User A shows "test, seconds ago"
this branch: User A shows "test, 2 minutes ago"
Screenshots
TODO
Checklist