Closed
Bug 1478787
Opened 6 years ago
Closed 6 years ago
sharedData.has() does not trigger an update
Categories
(Core :: IPC, defect, P3)
Core
IPC
Tracking
()
RESOLVED
FIXED
mozilla68
People
(Reporter: Felipe, Assigned: kmag)
References
Details
Attachments
(2 files)
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 hidden (mozreview-request) |
Comment 2•6 years ago
|
||
mozreview-review |
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-
Updated•6 years ago
|
Assignee: nobody → kmaglione+bmo
Flags: needinfo?(kmaglione+bmo)
Priority: -- → P3
Updated•6 years ago
|
Flags: needinfo?(kmaglione+bmo)
Comment 4•6 years ago
|
||
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.
Assignee | ||
Comment 5•6 years ago
|
||
(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.
Assignee | ||
Comment 6•6 years ago
|
||
MozReview-Commit-ID: 5aFVBNQW4QR
Assignee | ||
Comment 7•6 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8068f2c5ad489441277268b53e337a5b1de790d0
Bug 1478787: Rebuild stale SharedMap on Has() call. r=erahm
Comment 8•6 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox68:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla68
Updated•5 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•