-
-
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
occ: Improve user:lastseen
timestamp
#44666
Conversation
Hello all @nickvergessen @skjnldsv @ArtificialOwl @fenn-cs @come-nc -- I understand you've got a lot going on, but just a friendly question to see if the timetable for this might make it in before NC29 final at the end of this month, by any chance? If so, I'll get working on the documentation changes too, etc? |
The next RC release for |
Hi @fenn-cs Thanks for all that, it's helpful information. This is ready for review now. |
core/Command/User/Info.php
Outdated
if ($user->getLastLogin() == 0) { | ||
$lastseen = "never"; | ||
} else { | ||
$lastseen = date('Y-m-d H:i:s T', $user->getLastLogin()); |
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.
Both, the format change as well as the timezone change are breaking behaviour of the command that will result in breaking all tools/scripts that utilize those commands.
My recommendation would be to add an optional --timezone
argument and use the given timezone when provided and leave any calls without it untouched.
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.
Thank you for the input. I understand it's a breaking change. The point of this PR is to unify the timestamps though, and since 29.0.0 by way of semantic versioning denotes breaking changes in the API, breaking changes are acceptable, no?
At the moment we have different formatting at user:info
and user:lastseen
anyway, so unifying them (along with the bug fixing too) will be breaking changes in either case.
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.
While we try to follow semantic versioning, breaking should be avoided as much as possible, that includes changing defaults and things like this here.
A newly added optional parameter can be used to fix your case without breaking existing usages.
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.
Thank you for the note.
I am saying there will be a breaking change regardless though. Putting the formatting aside, fixing the bug when last seen time = 0 by saying "never" instead of returning Unix epoch will be a breaking change. And so if we're fixing an issue that will result in a breaking change anyway, why not unify the timestamp formatting while we're at it? Unless there's a reason that unifying the formatting change here is specifically undesirable?
Is the existing DateTimeInterface::ATOM
format consistent and the established default in occ
in other areas?
For background, and FWIW, the changes merged in #39669 changed the timestamp formatting in user:lastseen
from d.m.Y H:i
to Y-m-d H:i
without any controversy, and that's technically a breaking change for scripts.
I'm not trying to be difficult, just trying to understand the hesitancy.
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.
just trying to understand the rationale.
I missed it in the other PR.
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.
Well, you'll also note there then that @come-nc wanted to do some other cool stuff like a complete overhaul of the timestamp line to show the date first to allow better sorting (which would also be good)... But anyways.
I'd obviously like to see some changes here to have consistency, which is the whole point of this discussion, but if that stalemates, I'll retract. I'd rather not introduce a --timezone
argument that only applies to user:info
and not user:lastseen
-- my whole point here is looking for some consistency across occ
, which at the moment, we don't have (along with the bug fix).
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.
But the timezone used is consistent accross occ
, no? Only the date format is not always the same.
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.
Correct. 👍
Hi all, so just wondering how to move forward with this, given it's been a few weeks since our discussion where we've landed on the decision around keeping everything in UTC. Just wondering about the other parts:
|
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
Just a friendly follow up on #44666 (comment) |
Well, it’s complicated. I agree it would be better to show "never" rather than epoch, but changing that will break scripts relying on the output of the command.
I have no strong opinion about adding seconds and timezone to |
Thanks for getting back.
I appreciate and understand that. If we don't want to break things, then we can just leave it as it is. Or, as I've said above, I'm open to suggestions on how to make changes in the least disruptive/most useful way. PS what are some examples of all these scripts that are being referred to? And how is the importance of such 3rd party products considered against/above making changes to Nextcloud core?
I would prefer to introduce seconds to Before PR: Current PR: |
Hi all, just another friendly ping on #44666 (comment). |
Hi all, just another friendly ping on #44666 (comment), please? |
I do not have a good answer for that. I do not have an example of a script, it’s just that there may be some out there and we should not break compatibility without a good reason.
That part looks nicer indeed and I’d be fine with merging that. |
Thanks for responding. Great, if we agree on the And as I say, I won't keep pushing on the other, apart to still note in a friendly way, that it remains a bit confusing/dubious the reluctance over the tiniest breaking change for 3rd party scripts that are both uncited and still being considered above the level of core development... Again, I'm no longer pushing, we can compromise here, and I'll remove it from the PR, but I do want to say that I think returning epoch date is not only incorrect data (even if no NC servers have been running since 1970), it remains my view that it's a bug, and it should say 'never', which is the correct data. But I've said all this already many times ;) Anyway, will add a commit to reflect these discussions, and just accept the Thanks! |
CI failures unrelated, good for merging |
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.
🐘
Signed-off-by: Jore <contact@jore.cc>
Signed-off-by: Jore <contact@jore.cc>
Signed-off-by: Jore <contact@jore.cc>
Signed-off-by: Jore <contact@jore.cc>
Signed-off-by: Jore <contact@jore.cc>
Signed-off-by: Jore <contact@jore.cc>
user:lastseen
and user:info
timestampsuser:lastseen
timestamp
user:lastseen
timestamp #44641Summary
TODO
php.ini
settinguser:info
where last login is zero (don't show Unix epoch time)Checklist