fix: Sort by "last modified" (issue #5158) - #5265
Conversation
…ast-modified sorting Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…imitives at storage time Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…change detection Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…ore primitives Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…o prevent fake timestamps Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…q, curly braces) Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…le malformed dates Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…ed dates Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…rmalization Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
…act, skipSort?} Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
e72a0aa to
1e5e15c
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
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! (If you believe you should not receive this message, you can add yourself to the blocklist.) |
|
@GVodyanov could you take a look at this PR please? I don't want to and don't have the capacity to keep this PR up-to-date over months... |
hamza221
left a comment
There was a problem hiding this comment.
Thank you for the PR, The fix looks really promising
|
Could you also follow our AI-policy for commit messages https://github.com/nextcloud/contacts/blob/main/AGENTS.md#commit-message-format . |
- rebuild REV into extended ISO 8601 with a single normalization instead of chained regex replacements - document the ical.js fixed-position reformatting quirk that produces misplaced separators on REV values missing seconds - cover all supported REV formats with unit tests Assisted-by: Claude:claude-fable-5 Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
- split the zone suffix off the REV value before stripping separators so the minus of a negative UTC offset is no longer removed, which made parsing fail and the contact sort as if it had no REV - add unit tests for negative offsets in basic and extended format Assisted-by: Claude:claude-fable-5 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: v3DJG6GL <72495210+v3DJG6GL@users.noreply.github.com>
|
Needs conflict resolution |
…dified-5158 # Conflicts: # src/components/ContactsList.vue # src/models/contact.js # src/services/checks/invalidREV.js # src/store/contacts.js
conflicts resolved :) |
Summary
Fix #5158
With sort order set to Last modified:
Underlying issue: sorting crashed whenever any contact had a missing or malformed
REV(last-modified) value:The code called a date method on every contact's
REV. IfREVwas missing or not a valid date, it threw an error.Changes
nullif it's missing/unreadable).REVsort to the end instead of crashing the list.revgetter returnnullon error instead of throwing, so one contact with a brokenREVcan't crash the component that reads it.REV = nowwhen one is missing (both in theContactconstructor and in a background auto-"fix"). The old behavior made contacts jump to the top every time they were touched.REVdoesn't change just because it was viewed.LLM Disclosure
Developed with assistance from Claude Code (Opus 4.7, 1M context).
The LLM helped me identify the related files, code parts and proposed possible code modifications and fixes.
I've manually reviewed, the code the best I could.
A proper code review is required in any case...