Closed Bug 1167827 Opened 9 years ago Closed 9 years ago

Quietly ignore unknown visit codes

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla41
Tracking Status
firefox40 --- fixed
firefox41 --- fixed

People

(Reporter: rnewman, Assigned: rnewman)

Details

Attachments

(1 file)

Failing hard when encountering an unknown visit code seems counter-productive. Let's follow Postel's Law and accept unknown visit types in desktop Sync.
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Comment on attachment 8615744 [details] [diff] [review]
Quietly ignore unknown visit codes. v1

Review of attachment 8615744 [details] [diff] [review]:
-----------------------------------------------------------------

I assume there are no tests for these failures that you should update?

::: services/sync/modules/engines/history.js
@@ +276,5 @@
>        if (!visit.date || typeof visit.date != "number") {
>          this._log.warn("Encountered record with invalid visit date: "
>                         + visit.date);
>          throw "Visit has no date!";
>        }

should we do the same here? The case doesn't look very different, so it seems sensible to do.
Attachment #8615744 - Flags: review?(mak77) → review+
(In reply to Marco Bonardo [::mak] from comment #2)

> I assume there are no tests for these failures that you should update?

Huh, there is a test! Missed it the first time. Will update. 

> should we do the same here? The case doesn't look very different, so it
> seems sensible to do.

Having no date seems like a legit problem to me, but probably dying when processing the record isn't useful, so I guess I agree!
Comment on attachment 8615744 [details] [diff] [review]
Quietly ignore unknown visit codes. v1

Approval Request Comment
[Feature/regressing bug #]:
  None.

[User impact if declined]:
  Should be none. This tiny patch just makes Sync more fault tolerant.

[Describe test coverage new/current, TreeHerder]:
  Existing tests.

[Risks and why]: 
  It's possible for a malformed or extended history record to never be successfully processed by Sync, which will eventually be reported as an error. This patch eliminates most of that for history visits.
[String/UUID change made/needed]:
Attachment #8615744 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/080a87125d30
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Comment on attachment 8615744 [details] [diff] [review]
Quietly ignore unknown visit codes. v1

OK, let's do it.
Attachment #8615744 - Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: