Opened 12 years ago

Closed 11 years ago

#1020 closed bug (fixed)

No save alert message for a changed draft mail. (easy)

Reported by: kaoutsis Owned by: axeld
Priority: normal Milestone: R1
Component: Applications/Mail Version: R1/pre-alpha1
Keywords: Cc: ksmith
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Open BeMail and create a new mail. Fill <To> Fill <Subject> with foo (or anything you like). Write a line to the body text. Then File => Save as Draft Close BeMail.

Go to the Deskbar right click to the mail icon Go Open Draft select foo add a line to the main body text, and Close BeMail (click to the yellow button of the window manager) No save alert message. Open again the foo email the last line you had added is missing.

Attachments (2)

Mail.cpp.diff (1.1 KB) - added by kaoutsis 12 years ago.
posible fix
Mail.cpp.2.diff (292 bytes) - added by ksmith 12 years ago.
Fix for bug as discussed in comments.

Download all attachments as: .zip

Change History (12)

comment:1 in reply to:  description Changed 12 years ago by kaoutsis

Replying to kaoutsis: Correcting the description: Open BeMail and creat a new mail. Fill <To> Fill <Subject> with foo Write a line to the body text. Then File => Save as Draft Close BeMail.

Go to the Deskbar right click to the mail icon Go Open Draft select foo add a line to the main body text, Then File => Save as Draft. Add an other line. This time close BeMail by clicking to the yellow button of the window manager. No save alert message. Open again the foo email the last line you have added is missing.

Changed 12 years ago by kaoutsis

Attachment: Mail.cpp.diff added

posible fix

comment:2 Changed 12 years ago by kaoutsis

Please ignore the patch, since i introduced an other bug, and i must dig further.

comment:3 Changed 12 years ago by wkornewald

Summary: No save alert message for a changed draft mail.No save alert message for a changed draft mail. (easy)

comment:4 Changed 12 years ago by ksmith

Cc: ksmith added

I am unable to recreate this bug. It is properly asking me if I want to re-save the draft if I change it and close. Perhaps this has already been fixed?

comment:5 in reply to:  4 Changed 12 years ago by kaoutsis

Replying to ksmith:

I am unable to recreate this bug. It is properly asking me if I want to re-save the draft if I change it and close. Perhaps this has already been fixed?

tested again with hrev21691, i did the following: Open Mail; write a line; File => Save as Draft; write a second line; File => Save as Draft; add a third line; Close the Mail app (no alert message); open the draft mail; third line is missing:)

comment:6 Changed 12 years ago by ksmith

ok, I was able to re-create the bug.

At the end of SaveAsDraft(), we are setting fSent to true. This never gets reset to false when you change text anywhere in the email. Since this remains true, we don't satisfy the conditions in the if statement of QuitRequested(). Setting fSent to false in the case Field_CHANGED of the MessageReceived() seems to fix this bug. However, I am not sure if this would introduce any other bugs.

comment:7 in reply to:  6 Changed 12 years ago by kaoutsis

Replying to ksmith:

ok, I was able to re-create the bug.

At the end of SaveAsDraft(), we are setting fSent to true. This never gets reset to false when you change text anywhere in the email. Since this remains true, we don't satisfy the conditions in the if statement of QuitRequested(). Setting fSent to false in the case Field_CHANGED of the MessageReceived() seems to fix this bug. However, I am not sure if this would introduce any other bugs.

Now you give me an idea, we just have to do this: At the end of SaveAsDraft() we can change the fSent from true to false. After all is more logic (we just want to save and not to sent). Nothing more is needed. I already do that and after some tests, it looks like the bug indeed is fixed, the bug-fix is yours, and btw: welcome to the community:)

Changed 12 years ago by ksmith

Attachment: Mail.cpp.2.diff added

Fix for bug as discussed in comments.

comment:8 Changed 11 years ago by modeenf

Have any one checked this diff?

comment:9 Changed 11 years ago by kaoutsis

pending patch: Mail.cpp.2.diff from 26/07/07

comment:10 Changed 11 years ago by stippi

Resolution: fixed
Status: newclosed

Fixed in hrev28641. I didn't really apply your patches, since I believe fSent should not be set in SaveAsDraft() at all. SaveAsDraft() is only used from Send(), which maintains fSent itself.

Note: See TracTickets for help on using tickets.