Closed Bug 1408686 Opened 2 years ago Closed 2 years ago

Add a maintenance task to set missing last modified date and date added for bookmarks

Categories

(Toolkit :: Places, enhancement)

enhancement
Not set

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: Lina, Assigned: Lina)

Details

Attachments

(1 file)

Bug 1407922 has a database where a bookmark's `dateAdded` and `lastModified` are null. This will confuse Sync and the UI, so let's fix up bookmarks that don't have them.

We can try falling back to the oldest visit date from `moz_historyvisits` and the `last_visit_date` from `moz_places`, respectively, except those might *also* be null. Or we can unconditionally use the current date and time.
Assignee: nobody → kit
Status: NEW → ASSIGNED
Comment on attachment 8919030 [details]
Bug 1408686 - Add a maintenance task to set missing last modified date and date added for bookmarks.

https://reviewboard.mozilla.org/r/189938/#review195406

::: toolkit/components/places/PlacesDBUtils.jsm:860
(Diff revision 1)
> +             WHERE place_id = fk
> +           ), :currentTime)
> +       WHERE dateAdded IS NULL OR
> +             lastModified IS NULL`,
> +      params: {
> +        currentTime: PlacesUtils.toPRTime(new Date()),

FYI, you can generate a valid PRTime in SQL using SELECT strftime("%s", "now", "localtime", "utc") * 1000
It's pretty much equivalent to "new Date() * 1000"
Attachment #8919030 - Flags: review?(mak77) → review+
Pushed by kcambridge@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/0a9f04d67bd0
Add a maintenance task to set missing last modified date and date added for bookmarks. r=mak
https://hg.mozilla.org/mozilla-central/rev/0a9f04d67bd0
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in before you can comment on or make changes to this bug.