tabs.sendMessage should not raise an exception on unexistent tabId

RESOLVED FIXED in Firefox 44

Status

()

Toolkit
WebExtensions: Untriaged
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: rpl, Assigned: rpl)

Tracking

unspecified
mozilla44
Points:
---
Bug Flags:
blocking-webextensions +

Firefox Tracking Flags

(firefox44 fixed)

Details

(Whiteboard: [tabs])

Attachments

(1 attachment, 1 obsolete attachment)

(Assignee)

Description

2 years ago
browser.tabs.sendMessage currently raises an exception when the passed tabId doesn't exists in the tab manager because it tries to use an "undefined" tab.

I was going to raise an Error with a more descriptive message but I noticed that on Chrome it doesn't currently raise any error, it simply becames a no-op.
(Assignee)

Comment 1

2 years ago
Created attachment 8672863 [details] [diff] [review]
fix-and-testcase.patch

The attached patch contains a small change (tabs.sendMessage turned into a no-op if there is no tab with the defined tabId) and a related testcase.
Attachment #8672863 - Flags: review?(wmccloskey)

Updated

2 years ago
Whiteboard: [tabs]
Attachment #8672863 - Flags: review?(wmccloskey) → review+
(Assignee)

Updated

2 years ago
Assignee: nobody → luca.greco
(Assignee)

Comment 2

2 years ago
Created attachment 8674816 [details] [diff] [review]
fix-and-testcase.patch

I've checked that this patch applies cleanly on a recent mozilla-central and I've updated the commit message.
Attachment #8672863 - Attachment is obsolete: true

Updated

2 years ago
Blocks: 1214433
Hi Luca, is this ready for checkin?

Also, you can set the r+ flag on your own patch if I've reviewed a previous version and it hasn't changed significantly.
Flags: needinfo?(luca.greco)
(Assignee)

Comment 4

2 years ago
yes, it is

I was waiting for the "try build" to be completed:

https://treeherder.mozilla.org/#/jobs?repo=try&revision=63ac198f56f8

and the failures are unrelated to this change.

I'm going to add the r+ and the checkin-needed.
Flags: needinfo?(luca.greco)
(Assignee)

Updated

2 years ago
Attachment #8674816 - Flags: review+
(Assignee)

Updated

2 years ago
Keywords: checkin-needed

Comment 5

2 years ago
https://hg.mozilla.org/integration/fx-team/rev/bf9a0354bc7c
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/bf9a0354bc7c
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox44: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44

Updated

2 years ago
Flags: blocking-webextensions+
You need to log in before you can comment on or make changes to this bug.