Starred message shouldn't be deleted without alert/prompt
Categories
(Thunderbird :: Folder and Message Lists, enhancement)
Tracking
(Not tracked)
People
(Reporter: el.cameleon.1, Assigned: aceman)
References
()
Details
(Whiteboard: [GS])
Attachments
(1 file, 3 obsolete files)
14.05 KB,
patch
|
Details | Diff | Splinter Review |
Reporter | ||
Updated•13 years ago
|
Updated•13 years ago
|
Comment 1•11 years ago
|
||
Hi, may this be what is requested in this bug?
Some UX decisions needed for the comments in the patch.
Updated•6 years ago
|
Comment 3•6 years ago
|
||
Thanks, fixed the issues.
Comment 5•6 years ago
|
||
Reporter | ||
Comment 6•5 years ago
|
||
The same UI, but I implemented the check in a different place where other similar checks reside.
Incidentally it affected a test so it was easy to add a test for this feature.
Try run:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=2b257da2acd59e347e786d8a474467235fdbbd4c
Comment 8•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #8)
can you add a check for both cases, first put up the dialog bug press
cancel, then put it up and press accept
OK.
Please after deletion check the current message is as expected. Other tests
would of course start failing then, but it would be harder to understand why.Mochitest also likes that you check stuff (Assert.ok etc.), whereas mozmill
just checked everything kept going
OK.
::: mailnews/base/src/nsMsgDBView.cpp
The wording seems backwards.
mail.warn_on_delete_flagged
OK.
@@ +3065,5 @@
- if (!activePref) {
This seems wrong. Doesn't it clobber other prefs, like
confirmMsgDelete.deleteNoTrash.desc and news later?Looks like the thing with activePref should be in a helper function and not
like it currently is
Yes, this is strange, because the whole function works in the way that only the first check that passes wins. It sets activePref and then no other
checks and warnings are done.
So in that way if you try to delete a msg from Trash, you get the trash warning, bot no longer the "deleting starred message" or any warning about news.
I think this could be rewritten to show all warnings that actually apply to the selected messages, but I would propose a new bug.
Do you agree?
@@ +3076,5 @@
while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) {
nsCOMPtr<nsISupports> supports;
rv = enumerator->GetNext(getter_AddRefs(supports));
nsCOMPtr<nsIMsgDBHdr> msgHdr;
msgHdr = do_QueryInterface(supports, &rv);
put these two on the same line
also missing rv check
Yes, thanks.
Comment 10•5 years ago
|
||
Re-reading, maybe it's not worth doing in a helper, but just change the if's to be properly if and some else if. If you change it to use Preferences::GetBool instead of the old-style it would be much more readable. I would do it in this bug since it's so hard to verify the logic works in the current code.
![]() |
Assignee | |
Comment 11•5 years ago
|
||
I don't see the benefit in creating 10 indentation levels from if() else if() blocks.
This is what I proposed, a loop that can show multiple warning if they are relevant, e.g. try deleting a starred msg from trash.
For the test, I tried to first cancel the warning, but cancelling the deletion throws and I somehow can't catch it (probably because it is issued somewhere deep in the internals of the nsIMsgDBView.doCommand, not directly as result of the JS code), see the try run:
https://treeherder.mozilla.org/#/jobs?repo=try-comm-central&revision=bc07cadf38680b6549e8f6050a271e061ba9e9be
Comment 12•5 years ago
|
||
![]() |
Assignee | |
Comment 13•5 years ago
|
||
(In reply to Magnus Melin [:mkmelin] from comment #12)
::: mail/test/browser/folder-display/browser_messageCommandsOnMsgstore.js
@@ +203,5 @@
.querySelector("dialog")
.getButton("cancel")
.doCommand();
- } catch (e) {
- // Canceling the delete will throw.
Terrible API. Can we change that?
I don't know how to change it: https://bugzilla.mozilla.org/show_bug.cgi?id=1504002 . It looks similar to https://bugzilla.mozilla.org/show_bug.cgi?id=696186, but here (at least in the tests) the try {} catch{} does not seem to work.
Seems some formatting is off here.
As the catch does not work, I intentionally didn't bother with the formatting.
@@ +211,5 @@
- press_delete(mc);
- wait_for_modal_dialog("commonDialogWindow");
- // The message wasn't deleted so we still have it.
- curMessage = select_click_row(1);
- Assert.ok(curMessage.isFlagged, "Message should have been marked Flagged!");
can you do this check before you do anything, too. then here check that it's
the same message
OK, I can. But we need to solve the problem above. If we can't cancel the warning, there is nothing to check.
Updated•3 years ago
|
Description
•