Page MenuHomePhabricator

Bug 1996449 - Ensure runOncePerModification("displayMenuBar", ..) works as expected. r=mkaply
ClosedPublic

Authored by emilio on Nov 5 2025, 6:20 PM.
Referenced Files
Unknown Object (File)
Mon, Nov 9, 7:48 PM
Unknown Object (File)
Thu, Oct 29, 8:41 AM
Unknown Object (File)
Aug 19 2026, 6:14 PM
Unknown Object (File)
Aug 11 2026, 2:30 PM
Unknown Object (File)
Jul 4 2026, 4:25 PM
Unknown Object (File)
Jul 2 2026, 2:29 PM
Unknown Object (File)
Jun 29 2026, 3:25 PM
Unknown Object (File)
Jun 11 2026, 12:20 PM
Subscribers

Details

Summary

runOncePerModification works on strings. If you pass a boolean down it
will always call its callback (because "true" != true etc).

Event Timeline

phab-bot published this revision for review.Nov 5 2025, 6:20 PM
phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
mossop added inline comments.
browser/components/enterprisepolicies/Policies.sys.mjs
1164

This seems like a footgun. Can we instead modify runOncePerModification to stringify the value before doing the comparison?

emilio marked an inline comment as done.
emilio added inline comments.
browser/components/enterprisepolicies/Policies.sys.mjs
1164

This seems like a footgun. Can we instead modify runOncePerModification to stringify the value before doing the comparison?

Sure, in fact at first I thought of that but it was documented to take a string... Do you know if we're thinking of adding types to JS long term? It seems like typescript would've caught this.

emilio marked an inline comment as done.
mossop added 1 blocking reviewer(s): mkaply.
mossop added inline comments.
browser/components/enterprisepolicies/Policies.sys.mjs
1164

Yes we are and in fact I'm delighted to have examples to point to where they would have helped!

This revision is now accepted and ready to land.Nov 7 2025, 6:35 PM

This revision requires a Testing Policy Project Tag to be set before landing. Please apply one of testing-approved, testing-exception-unchanged, testing-exception-ui, testing-exception-elsewhere, testing-exception-other. Tip: this Firefox add-on makes it easy!

This revision is now accepted and ready to land.Nov 8 2025, 12:28 PM