Closed Bug 91936 Opened 23 years ago Closed 23 years ago

"send unsent messages" menu item is disabled if you do a send later,exit browser, and restart/login to messenger

Categories

(MailNews Core :: Backend, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: blizzard, Assigned: Bienvenu)

References

Details

(Whiteboard: PDT+)

Attachments

(2 files)

Build is from July 23, 2001.

When I'm offline and compose a message the message is saved to the "Unsent
Messages" folder.  When I go online the menu option in the File menu is never
active so I can't send unsent messages.

Also, when I go online I'm never asked if it's OK to send the unsent messages
even though I have the preference set.  This sounds like the same problem.
it's the FE that disables that command
Assignee: bienvenu → mohanb
Blizzard, this is a dupe of a bug i found earlier
bug 81625 ?
Maybe this one is a little bit more extended
Ok. I assuming we are talking about trunk builds.

I tested 2001-07-23-09-trunk for Win NT 4.0 and
2001-07-23-08-trunk for linux 2.2.

I am using new profiles for both platforms.

Couple of questions:
1. In Prefs|Offline and DiskSpace
   what is your pref set for ?
       when going online
              - ask me
              - automatically send
              - don't send
2. Do you have the checkbox 'always ask
me when I go online' in the work online window prompt,
checked?

There is a bug, bug 79245, that fixed the 
'do you want to send unsent messages' prompt if you had
NO unsent messages. It was working ok but still little
buggy. 

There is also a bug, bug 82568, that
if the checkbox is checked 'Always ask me before i go online'
it will reflect in the prefs|offline and disk space settings.
This seemed to be working.

Anyways, following your steps to reproduce (on both windows & linux), I
currently don't see anything wrong.
steps I did:
1.My prefs are set to 'ask me' when I go online and offline
2.Go offline (either by icon or using file menu)
3.I say don't download (and don't check the check box)
4.Compose new mesg
5.Select Send later.
6.Mesg is saved to Unsent Messages folder
7.I go online (either by icon or using file menu)
8.I click 'dont send' button.
9.I go to the File menu
10. Send Unsent Messages is enabled,I select that, and
   messages are sent and I receive it in inbox.

I also tried setting the pref 'Do not send my unsent messages'
(which disables the send unsend messages prompt when you
go online) and then going to the File menu and Send Unsent
Messages is enabled. I then selected it and my message was
sent.

Maybe try a new profile? Or If I am missing step, please
let me know.

Francisco I think this bug is different from yours. Chris
can't send unsent messages while you want a window that
gives you some sort of feedback. There is a couple of
bugs for some sort of progress windows (bug 78900 & bug
66916) but none specifically sending unsent messaes.

As for no 'activity' when sending unsent messages,
you are correct as the only 'activity' is a message
on bottom frame of Messenger saying 'sending Unsent messages'.
Ah ha!  Ok, if I follow these steps that you describe I can send email.  The
problem is that I will sometimes close the browser in between the time that I go
back online and will want to send the mail later.  Here are the steps to reproduce:

1. Go offline
2. Click "Don't Download"
3. Compose a message
4. Click "Send Later"
5. Quit
6. Start the browser.

Note that you are now online, the message is in "Unsent Messages" but the menu
item is still grayed out.  Also, if you go offline and back online you won't get
a prompt to send the message.

Here are my prefs to answer your question:

when going online: ask me

and the checkbox for "always ask when I go online" is checked as well.
Summary: "send unsent messages" menu item never activated → "send unsent messages" menu item never activated after going online
Ok confirmed using Chris's steps
that if you do a send later, exit browser, restart
messenger and login to your imap account: the
menu item "Send unsent messages" is indeed greyed
out.

Confirmed on all 3 platforms:
Commercial builds:
2001-07-23-09-trunk for Win NT 4.0  
2001-07-23-08-trunk for linux 2.2.
2001-07-23-08-trunk for mac 9.0.4

Changing summary slightly.
Old summary was:
"send unsent messages" menu item never activated after going online
Summary: "send unsent messages" menu item never activated after going online → offline: "send unsent messages" menu item is disabled if you do a send later,exit browser(while still offline),and restart/login to messenger
This bug also manifests, regardless of prefs settings, of you are on or offline,
and:

1. Compose a message.
2. File | Send later.
..later, with or without a browser restart,
3. File | Send Unsent Messages (is disabled, and cannot be used)
Yes, I have the problem when I restart Mozilla. Workaround - the menu item is
enabled after I queue one more message.
this bug start to drive me nuts! especially when I try to work on errors 
reporting during send unsent message.
Keywords: nsenterprise
Some more steps to reproduce:

-Write a mail. Click on Send Later.
(Send Unsent Messages is now active.)
-Close and restart Mozilla.
(Send Unsent Messages is now grayed.)
-Write another mail. Click on Send Later.
(Send Unsent Messages is still grayed.)
-Delete both mails, write another.
(Send Unsent Messages is still grayed.)
-Delete the message. 
-Restart Mozilla.
-Write a mail. Click on Send Later.
(Send Unsent Messages is now active again.)

I'm using build 2001082109. I never work offline. As long as I dont restart
Mozilla after writing mails, Unsent Messages works fine. Send Unsent Messages
seems to work only if the unsent messages folder was empty on mozilla startup.
As a workaround, you can open all mails in unsent messages by Edit As New and
send them directly. After that, delete them in Unsent Messages and restart Mozilla.
*** Bug 97043 has been marked as a duplicate of this bug. ***
Severity of this error should be "major" as it makes mail all-but-unusable for
dialup users. Surely this can't bee THAT hard to fix, since the error only
appeared sometime around 0.9
*** Bug 98342 has been marked as a duplicate of this bug. ***
Ok, this bug has nothing to do with "going offline" removing from summary
Setting to "Mail Back End??". Seeing this in Windows as well as linux, OS
setting to ALL.
Also, interesting note, this bug was reported pre Netscape 6.1, and in my
testing NS 6.1 does not have this bug, but all current builds do. So its a bug
apparently from something that landed in 0.9.3 that didn't land in 0.9.2.1 :)
Component: Offline → Mail Back End
OS: Linux → All
Summary: offline: "send unsent messages" menu item is disabled if you do a send later,exit browser(while still offline),and restart/login to messenger → "send unsent messages" menu item is disabled if you do a send later,exit browser, and restart/login to messenger
reassigning to jpm (please find a new owner)
Assignee: mohanb → jpm
David, could you take a look at this? Thanks -- Jussi-Pekka
Assignee: jpm → bienvenu
Can people who see this bug try it again with a build from Monday or later? I
fixed a very possibly related bug then. 
The same behavior exists in last night's build...
this works fine for me
Mike, can you send me your prefs.js file, so I can see if anything is amiss?
thanks. I can't reproduce this problem. Has anyone tried clicking on the unsent
messages folder to see if that fixes the problem? I'm wondering if the database
is out of sync with the folder...
This problem might be limited to migrated profiles - there's some profile
migration code that generates an unescaped uri for the following pref:
"mail.default_sendlater_uri". I can fix the migration code but we would still
need to deal with previously migrated profiles. I'll attach a fix for the
profile migration code.
Confirmed with your analysis David.

Using commercial trunk builds:
 2001091703 on Win 2k
 2001091708 mac 9.1
 2001091708 linux 2.2

Using a IMAP mail account.

Tested both new profiles and converted profiles. Problem
with Migrated Profiles.

 New profiles - no problem. Login. go offline, Do a send later. 
                exit mozilla. restart mozilla. login to mail and 
                Send Unsent messages is enabled from file menu

 Migrated profiles - doesn't work. Do exact same steps but
                     when you restart and go to messenger 
                     send unsent messages is grayed out.

                     
I'll attach a patch for code that automatically escapes that pref if it finds a
space in the value, to try to handle the case of already migrated profiles.
Status: NEW → ASSIGNED
It works now for me, but I don't need to apply the patch nor change the pref.js.
However, it would be good if Mozilla shows a little progress bar indicating that
it's sending unsent mails.  Actually, I click on "Send unsent messages" and
Mozilla didn't seem to work (but indeed it did), so I clicked once more and
finally it ended up sending the mails twice!
Without the progress bar, we really don't know what Mozilla is doing.
Yes, I changed a default pref (part of a different bug) that fixed it for lots
of people. Re status, well, we should probably be popping up a message send
progress window, or make it so the message send would send progress/status to
the normal 3 pane ui - it used to do that. Why doesn't that work any more,
Jean-Francois?
JF and Seth, can I get reviews for these two patches? I basically look for a
space in the default_sendlater uri, if I find one, replace them all with %20 and
rewrite the pref. I tried just escaping the uri, but I ran into a problem
because the uri is "mailbox://nobody@Local Folders/Unsent Messages" and escaping
the whole thing causes the ':' or the '/' to get escaped, I can't remember
which. Not sure how this will play with i18n, but the profile migration code
just writes out "unsent messages", so I don't think we should worry abuot that here.
Comment on attachment 50081 [details] [diff] [review]
patch to upgrade unescaped prefs

R=ducarroz
Attachment #50081 - Flags: review+
instead of search and replacing " " with "%20", why not:  if current string 
is "mailbox://nobody@Local Folders/Unsent Messages" then set it 
to "mailbox://nobody@Local%20Folders/Unsent%20Messages"

on a related note, nsMessengerMigrator::SetSendLaterUriPref() is broken

nsMessengerMigrator.cpp, this should be fixed, too:

- #define UNSENT_MESSAGES_FOLDER_NAME "Unsent Messages"
+ #define UNSENT_MESSAGES_FOLDER_NAME "Unsent%20Messages"

Or if we leave it alone, we should escape it when used.  (in SetSendLaterUriPref
())

also check out nsIPrefMigration.idl, which defines:

#define NEW_LOCAL_MAIL_DIR_NAME "Local Folders"

which is used in nsMessengerMigrator.cpp

when used to point to file on disk, "Local Folders" is correct.  but if we use 
it to generate a uri, we need to make it "Local%20Folders".  We use that value 
in SetSendLaterUriPref().

I think a bunch of code is going to need some close inspection, but not 
necessarily right now.

there seem to be a bunch of potential scenarios where we end up with uri's with 
spaces, that aren't escaped.

yikes, something that bienvenu pointed out, "how did this ever work"?

I can work with david to help to decide what needs to be done first, and what 
can be spun off and dealt with later.
I need to double check fcc_folder (sent), draft_folder, stationery_folder 
(templates) and unsent messages migration.

david fixed the bad defaults in mailnews.js

"mail.identity.default.fcc_folder" 
"mail.identity.default.draft_folder"
"mail.identity.default.stationery_folder"
"mail.default_sendlater_uri"

but we may be creating bad values on migration.
Comment on attachment 49856 [details] [diff] [review]
fix for the profile migration code

sr=sspitzer, assuming that is only used when creating the sendlater uri.
Attachment #49856 - Flags: superreview+
Comment on attachment 50081 [details] [diff] [review]
patch to upgrade unescaped prefs

thanks for fixing GetUnsentMessagesFolder() to use GetFolderURIFromUserPrefs()
Attachment #50081 - Flags: superreview+
I'll go spin off the migration bug, about how we're generating uri's that 
aren't escaped, and how we're doing other bad things.

wee!
spun off bugs #100854 and #100857
Seth or David.

Would the problems both of you stated above 
explain how sometimes (i was testing bug 79245)
that with a migrated profile, I sometimes see this:
  -once profile converted, login to imap mail,
   compose a mesg, do a send later, and then go to file menu
   but for some reason 'send unsent mesgs' is disabled
  -once profile converted, login to imap mail, go offline
   compose a mesg, do a send later, go back online, but
   no prompt asking me to send unsent mesgs (even though
   i have that pref set to ask me). And 'send unsent mesgs' 
   is disabled from file menu
fixes checked in. I hope this resolves the problem for anyone still having it.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
marking nsbranch+ and PDT.  Can one of you come to the noon PDT on Monday to 
discuss moving to the branch?  What's the risk?  I think ent customers are going 
to complain about this.  Thanks.
Keywords: nsbranch+
Whiteboard: PDT
Gary, yes, this fix should fix the problem you describe.

Greg, I'm not in Mountain View, so I can't come to the PDT. The risk is minimal
and new trunk builds with this fix seem to be fixing this problem for various
mozilla users. Please let me know if I should check this into the branch.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
david you can ignore greg's comment. That's what I'm for. I go to every PDT
meeting to talk about the bugs we want to land on the branch for our group. Greg
just forgot =). 

Adding to our tracking bug. 
Blocks: 99508
Testing commercial trunk builds
2001092403 nt 4.0
2001092408 linux 2.2
2001092409 mac 9.1

Looks like it's fixed. No problem sending unsent messages online or
offline. Tried new profiles/existing profiles. Tested sending
after quiting the application and then restarting it, no probs.

Tested sending through the unsent messages prompt and that worked to.
Tested the file menu 'send unsent messages' no problem.

Couldn't find any regressions or anything.  I say land it. 
check it in - PDT+
Whiteboard: PDT → PDT+
fix checked into branch
Status: REOPENED → RESOLVED
Closed: 23 years ago23 years ago
Resolution: --- → FIXED
Using commercial branch builds (9.4)
20010925 nt 4.0, linux 2.2, mac 9.1

Tested new/migrated profiles, doing a send later while
online, sending later while offline, storing messages
in unsent mesgs folder and quiting the application
and then restarting, etc.. and I am able to
send unsent messages with no problem. The File menu
item is available (assuming there is a mesg in unsent
folder) if quit the browser, restart, and login to messenger.

Marking as verified. Not adding keyword vtrunk since I verified
this fix on the trunk first before it landed on the branch.

 
Status: RESOLVED → VERIFIED
*** Bug 101529 has been marked as a duplicate of this bug. ***
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: