Error: "caller is undefined" in ActivitiesService.jsm, line 305

RESOLVED FIXED

Status

defect
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: ttaubert, Assigned: fabrice)

Tracking

unspecified
ARM
Gonk (Firefox OS)
Dependency tree / graph
Bug Flags:
in-testsuite -

Firefox Tracking Flags

(blocking-basecamp:+, firefox18 fixed, firefox19 fixed)

Details

Attachments

(1 attachment)

STR:

1) Open the contacts app
2) click an existing contact
3) click on the message icon to write a new text message

You see the following error pop up:

Error: "caller is undefined" {file: "resource://gre/modules/ActivitiesService.jsm" line: 305}]

This is caused by this line:

http://hg.mozilla.org/mozilla-central/annotate/3621795c03e1/dom/activities/src/ActivitiesService.jsm#l246

I don't know what's the appropriate behavior here. Should we just return when (!caller)?
Assignee

Updated

7 years ago
blocking-basecamp: --- → ?
Component: Gaia → General
Assignee: nobody → fabrice
blocking-basecamp: ? → +
Assignee

Comment 1

7 years ago
The SMS app does not specify "returnValue" for the "new" activity, so we bail out early at https://mxr.mozilla.org/mozilla-central/source/dom/activities/src/ActivitiesService.jsm#246

but then it sends a result at https://github.com/mozilla-b2g/gaia/blob/master/apps/sms/js/sms.js#L1475

So my take is that:
1) we should return early when (!caller)
2) this means that the calling app is faulty, and we need to fix the sms app (either by adding "returnValue: true" in the manifest or by not doing a postResult)
Assignee

Comment 2

7 years ago
Posted patch patchSplinter Review
I filed bug 806490 to get the sms app fixed. The gecko patch is enough to prevent errors, but the calling app may not receive what it expects.
Attachment #676253 - Flags: review?(clian)
Comment on attachment 676253 [details] [diff] [review]
patch

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

::: dom/activities/src/ActivitiesService.jsm
@@ +294,1 @@
>        }

Cool! I'd prefer:

  if (!caller) {
    debug("!! caller is null for msg.id=" + msg.id);
    return;
  }

  obsData = JSON.stringify({ ... });

but have no strong opinion if you like the original one. :D
Attachment #676253 - Flags: review?(clian) → review+
https://hg.mozilla.org/mozilla-central/rev/078e5c209552
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.