sharedData.has() does not trigger an update

RESOLVED FIXED in Firefox 68

Status

()

defect
P3
normal
RESOLVED FIXED
Last year
Last month

People

(Reporter: Felipe, Assigned: kmag)

Tracking

Trunk
mozilla68
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox63 wontfix, firefox68 fixed)

Details

Attachments

(2 attachments)

Something that tripped me up today as I was trying to use sharedData:

-- in the parent -- 

Services.ppmm.sharedData.set("foo", "bar");
Services.ppmm.sharedData.flush();

-- in content --

Services.cpmm.sharedData.has("foo"); // returns false



If .has is replaced by .get(), or something else caused it to decode (e.g. iterating over the entries*), then it works.


* good old "I added logging to dump all the entries to see if I had a typo somewhere and then it worked"
Comment on attachment 8995313 [details]
Bug 1478787: Rebuild stale SharedMap on Has() call.

https://reviewboard.mozilla.org/r/259776/#review266818

The fix looks fine, but please tests for `has`.

Also can you double check we're testing the full [interface](https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/dom/chrome-webidl/MozSharedMap.webidl#19-54). `get`, `set`, `delete`, and `flush` all seem to be covered in the [unit test](https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/dom/ipc/tests/test_sharedMap.js). I *think* [enumeration is covered](https://searchfox.org/mozilla-central/rev/d47c829065767b6f36d29303d650bffb7c4f94a3/dom/ipc/tests/test_sharedMap.js#29-37) but it would be good to double check.
Attachment #8995313 - Flags: review?(erahm) → review-
Assignee: nobody → kmaglione+bmo
Flags: needinfo?(kmaglione+bmo)
Priority: -- → P3
Flags: needinfo?(kmaglione+bmo)
Duplicate of this bug: 1547861

Do we actually need the has method? I'm struggling to think of a case where you'd want to test if a key exists and then not get it.

(In reply to Dave Townsend [:mossop] (he/him) from comment #4)

Do we actually need the has method?

Probably not, but regular Map has one, so.

MozReview-Commit-ID: 5aFVBNQW4QR

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
You need to log in before you can comment on or make changes to this bug.