Created attachment 8805631
change-m_sendDone-semantics.diff
Kent, this is how I would improve upon your patch. But my fear is that if we change the m_sendDone semantics, it will require complicated code to fix the two-dialogs problem, and so the two-dialogs problem will never be fixed.
> You should not include a file from a specific protocol in this file which is
> used for a generic protocol.
We can avoid referencing NS_ERROR_BUT_DONT_SHOW_ALERT in nsMsgProtocol::OnStopRequest by simply deleting the NS_ASSERTION from nsMsgProtocol::OnStopRequest. We'd have to do this anyway if we change the m_sendDone semantics.
> On the issue of too many error messages, actually the protocol code is
> supposed to handle this using m_urlErrorState, which is set to
> NS_ERROR_BUT_DONT_SHOW_ALERT after the alert shows that is the primary error
> message. So the existing code already had a mechanism to try to handle this.
> Trying to also fix it here is really a kludge. If you want to fix this, you
> need to figure out why the existing method is not doing what you want.
The protocol code is okay except that it has no way to tell the rest of the mail-sending code that an alert should not be shown for a network error following another error. The only solution I can see is to make nsSmtpProtocol::OnStopRequest change the error to NS_ERROR_BUT_DONT_SHOW_ALERT if m_nextStateAfterResponse == SMTP_ERROR_DONE.
Don't get me wrong; I am really happy to see movement on this bug, and I agree that pretty much anything would be better than what we have now.
Created attachment 8805631 m_sendDone- semantics. diff
change-
Kent, this is how I would improve upon your patch. But my fear is that if we change the m_sendDone semantics, it will require complicated code to fix the two-dialogs problem, and so the two-dialogs problem will never be fixed.
> You should not include a file from a specific protocol in this file which is
> used for a generic protocol.
We can avoid referencing NS_ERROR_ BUT_DONT_ SHOW_ALERT in nsMsgProtocol: :OnStopRequest by simply deleting the NS_ASSERTION from nsMsgProtocol: :OnStopRequest. We'd have to do this anyway if we change the m_sendDone semantics.
> On the issue of too many error messages, actually the protocol code is BUT_DONT_ SHOW_ALERT after the alert shows that is the primary error
> supposed to handle this using m_urlErrorState, which is set to
> NS_ERROR_
> message. So the existing code already had a mechanism to try to handle this.
> Trying to also fix it here is really a kludge. If you want to fix this, you
> need to figure out why the existing method is not doing what you want.
The protocol code is okay except that it has no way to tell the rest of the mail-sending code that an alert should not be shown for a network error following another error. The only solution I can see is to make nsSmtpProtocol: :OnStopRequest change the error to NS_ERROR_ BUT_DONT_ SHOW_ALERT if m_nextStateAfte rResponse == SMTP_ERROR_DONE.
Don't get me wrong; I am really happy to see movement on this bug, and I agree that pretty much anything would be better than what we have now.