Closed Bug 1061614 Opened 10 years ago Closed 10 years ago

Call log database upgrade path to schema 4 wrongly puts calls one week apart in the same group

Categories

(Firefox OS Graveyard :: Gaia::Dialer, defect)

defect
Not set
normal

Tracking

(b2g-v1.4 affected, b2g-v2.0 affected, b2g-v2.0M wontfix, b2g-v2.1 affected, b2g-v2.2 fixed)

RESOLVED FIXED
2.1 S5 (26sep)
Tracking Status
b2g-v1.4 --- affected
b2g-v2.0 --- affected
b2g-v2.0M --- wontfix
b2g-v2.1 --- affected
b2g-v2.2 --- fixed

People

(Reporter: rik, Assigned: gsvelto)

References

Details

Attachments

(2 files)

While working on bug 877971, we noticed that our reference workloads sometimes have incoherent data. The day used as part of the id for dialerGroups was not the same day as the lastEntryDate. Some records had a one week difference.
Jon: You've worked on those, how where they generated? We may want to regenerate them because of those problems and maybe also to include some new data like bug 1047351.
Flags: needinfo?(jhylands)
Anthony,

Right now regenerating reference workloads is problematic - I used to use a specialized version of b2g-desktop (RIL-enabled), but that option is no longer available.

We need in general to look at re-doing the generation of reference workloads so they can be generated on demand. Note however that once we generate with a specific version, the databases are forwards compatible with that and future version, but they are definitely not backwards compatible with older versions.
Flags: needinfo?(jhylands)
And if you're getting incoherent data, you might want to double-check the migration code for the dialer database - that may be causing the problem.
I stumbled upon this while investigating bug 1029142 and as it turns out our upgrade code is seriously broken. The issue is here:

https://github.com/mozilla-b2g/gaia/blob/8f01920c210841852b543a3775c750437dd4ec44/apps/communications/dialer/js/call_log_db.js#L388

We're creating a unique key which uses getDay() to extract the day from a Date object but getDay() returns the day-of-the-week, not the day-of-the-month (that's getDate(), so intuitive...), so calls one week apart are merged into the same group.

Changing the title to something more descriptive and setting the flags. This has been broken since v1.1, woot!
Assignee: nobody → gsvelto
Status: NEW → ASSIGNED
Summary: reference-workload for Dialer have some inconsistencies → Call log database upgrade path to schema 4 wrongly puts calls one week apart in the same group
One-liner fix. Unfortunately this is not covered by unit-tests at all and due to all the IndexedDB interaction writing one for this case would be a significant undertaking. I won't provide ones mostly because this code is unlikely to change in the future and thus we're also unlikely to introduce regressions.
Attachment #8493819 - Flags: review?(anthony)
Attachment #8493819 - Flags: review?(anthony) → review+
Thanks for the review! Here's the PR + try run, waiting for Try to turn green before merging.
Target Milestone: --- → 2.1 S5 (26sep)
Oh, integration tests, why dost thou always take three tries before finishing successfully? Anyway, green Try run:

https://tbpl.mozilla.org/?rev=59f3d6343148f392af96400b883e871dae69d589&tree=Gaia-Try

Merged to gaia/master 6d87102974b6b6f2d8baa0b7763534897258ff44

https://github.com/mozilla-b2g/gaia/commit/6d87102974b6b6f2d8baa0b7763534897258ff44
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
blocking-b2g: --- → 2.0M?
Blocks: Woodduck
blocking-b2g: 2.0M? → ---
Triage:
Low impact on Woodduck.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: