Say the Archive folder needs the role, not the name

Archiving looks the folder up by its special-use role and by nothing else --
roleId("archive"), falling back to roleId("all") -- and then, finding
neither, told you to create a folder named "Archive". Naming a folder does
not give it a role, and ihasmail has no way to assign one: Folders settings
shows the role beside a folder and offers no way to set it. So the advice
sent someone round a loop that could not end. They make the folder, it still
does not work, and the message says the same thing again.

It now says what is actually required and where it lives: a folder needs the
Archive role on the server, and naming it "Archive" is not enough.

All nine catalogues carry the correction rather than falling back to English,
and they need the same native review the rest of them do.

The existing test asserted only that archiving complained. It now checks what
the complaint says, since the words were the whole bug.

Closes #217.
This commit is contained in:
2026-09-02 08:00:46 -07:00
parent 3f33b61369
commit 1611ae6918
11 changed files with 20 additions and 11 deletions
@@ -177,6 +177,15 @@ describe("archiveByDate", () => {
expect(s.created).toEqual([]);
expect(s.moves).toEqual([]);
expect(messages()[0]).toContain("No Archive folder");
/*
* What it says, not just that it complains. The folder is found by its
* special-use role and by nothing else, so telling someone to create a
* folder *named* "Archive" sent them round a loop that could not end --
* naming a folder does not give it the role, and ihasmail cannot assign
* one. Issue #217.
*/
expect(messages()[0]).toContain("role");
expect(messages()[0]).not.toMatch(/Create one named/);
});
it("has nothing to do with an empty selection", async () => {
+2 -2
View File
@@ -610,7 +610,7 @@ export const useMail = create<MailState>((set, get) => ({
async archive(ids) {
const archiveId = get().roleId("archive") ?? get().roleId("all");
if (!archiveId) {
toast.error(t("No Archive folder found. Create one named “Archive” first."));
toast.error(t("No Archive folder is set. A folder needs the Archive role on the server; naming it “Archive” is not enough."));
return;
}
await get().move(ids, archiveId, { label: "Archive" });
@@ -621,7 +621,7 @@ export const useMail = create<MailState>((set, get) => ({
const archiveId = get().roleId("archive") ?? get().roleId("all");
if (!accountId || !ids.length) return;
if (!archiveId) {
toast.error(t("No Archive folder found. Create one named “Archive” first."));
toast.error(t("No Archive folder is set. A folder needs the Archive role on the server; naming it “Archive” is not enough."));
return;
}
const { emails } = get();