isCommandEnabled must not have side-effects

REOPENED
Unassigned

Status

--
minor
REOPENED
14 years ago
5 years ago

People

(Reporter: eyalroz, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)
Build Identifier: 

The method 'isCommandEnabled' of controllers must not have side-effects. It 
must only check _whether_a_command_is_enabled_or_not_, and that's it. Other 
methods must be defined in the controller interface for updating state, and 
called when necessary. Alternatively, there can just be a single 'update state 
and report some boolean values' method. What we have now is very confusing 
design (one might be tempted to say 'broken').


Example:

http://lxr.mozilla.org/seamonkey/source/editor/ui/composer/content/ComposerComma
nds.js#524

Reproducible: Always
Steps to Reproduce:
Product: MailNews → Core
This is an automated message, with ID "auto-resolve01".

This bug has had no comments for a long time. Statistically, we have found that
bug reports that have not been confirmed by a second user after three months are
highly unlikely to be the source of a fix to the code.

While your input is very important to us, our resources are limited and so we
are asking for your help in focussing our efforts. If you can still reproduce
this problem in the latest version of the product (see below for how to obtain a
copy) or, for feature requests, if it's not present in the latest version and
you still believe we should implement it, please visit the URL of this bug
(given at the top of this mail) and add a comment to that effect, giving more
reproduction information if you have it.

If it is not a problem any longer, you need take no action. If this bug is not
changed in any way in the next two weeks, it will be automatically resolved.
Thank you for your help in this matter.

The latest beta releases can be obtained from:
Firefox:     http://www.mozilla.org/projects/firefox/
Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html
Seamonkey:   http://www.mozilla.org/projects/seamonkey/
(Reporter)

Updated

13 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
sorry for the spam.  making bugzilla reflect reality as I'm not working on these bugs.  filter on FOOBARCHEESE to remove these in bulk.
Assignee: sspitzer → nobody

Updated

10 years ago
QA Contact: composition
(Assignee)

Updated

10 years ago
Product: Core → MailNews Core

Updated

5 years ago
Severity: normal → minor
(Reporter)

Comment 4

5 years ago
Not seeing side-effects at the moment... must have been fixed at some point.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Looks to me UpdateStructToolbar is called in nsUpdateStructToolbarCommand isCommandEnabled as i linked in comment 3, and that seems to do things that could have side-effects. 

(Also we use WORKSFORME when we don't know what patch fixed it.)
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
You need to log in before you can comment on or make changes to this bug.