Closed Bug 694657 Opened 12 years ago Closed 12 years ago

Sync: test JS server 404 for GET on missing WBO

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: rnewman, Assigned: rnewman)

Details

(Whiteboard: [fixed in services][qa-])

Attachments

(1 file)

There was a case where a 404 for a WBO in a non-existent collection would return 200. Here's a patch.
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #567179 - Flags: review?(philipp)
Comment on attachment 567179 [details] [diff] [review]
Proposed patch. v1

>       switch (req.method) {
>         case "GET":
>           if (!coll) {
>+            if (wboID) {
>+              respond(404, "Not found", "Not found");
>+              return;
>+            }
>             // *cries inside*: Bug 687299.
>             respond(200, "OK", "[]");

You and me, brother.


>+  function getMissingCollectionWBO(next) {
>+    _("Testing that fetching a WBO from an on-existent collection 404s.");
>+    let req = localRequest(storageURL + "/foobar/baz");
>+    req.get(function (err) {
>+      do_check_eq(this.response.status, 404);
>+      Utils.nextTick(next);
>+    });
>+  }
>+
>+  s.start(8080,

(sigh @ one letter variable name)

r=me
Attachment #567179 - Flags: review?(philipp) → review+
https://hg.mozilla.org/mozilla-central/rev/9c072e3fa138
https://hg.mozilla.org/mozilla-central/rev/8c1ad90b6804
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
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.