New mail in the other signed-in accounts: counts, a dot, and a notification
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m24s
ci / announce (pull_request) Skipped
ci / node (pull_request) Skipped
ci / version (pull_request) Skipped
ci / docker-build (pull_request) Skipped
ci / publish (pull_request) Skipped
github/ci (branch) GitHub Actions
ci / github (pull_request) Successful in 2m24s
ci / announce (pull_request) Skipped
With more than one account signed in (#49), mail arriving in one that isn't in front went unseen until someone switched to it (multi-account spec, MA-8). - GET /api/auth/accounts/unread answers the Inbox unread count of each account not in front, asked through that account's own session (its OAuth token renewed first if due), kept a minute per account. - The web app asks every two minutes while another account is signed in. The account menu shows each one's count beside its name, and the avatar carries a dot when any of them has unread mail. - When a count rises while the app is open and desktop notifications are on, a notification names the account ("New mail for [email protected]"); clicking it switches to that account. An account seen for the first time doesn't notify: its mail was already there. Not in this change: notifications with the app closed, which need each added account's own Web Push subscription. New strings (3, English only in the other ten catalogs): "New mail for {name}", "Unread in the Inbox: {count}", "Account: new mail in another account". Tests: the server answers the other account's count and nothing when alone; the client keeps the counts, notifies only on a rise and only with notifications on. Checked in Chrome against the mock. typecheck, tests (web 1541, server 277) and build pass.
This commit is contained in:
1 parent
68c91a1ad4
commit
5f27923ce6
6 files changed
+234
-2
No files matched your search
@@ -139,3 +139,18 @@ test("an organization that doesn't allow it keeps adding off", async () => {
|
||||
delete process.env.MOCK_NO_ADD_ACCOUNTS;
|
||||
}
|
||||
});
|
||||
|
||||
test("inbuxa MA-8: the accounts not in front report their Inbox unread count", async () => {
|
||||
const b = new Browser();
|
||||
await b.signIn("[email protected]", "first-password");
|
||||
// Alone, there is nothing to report
|
||||
assert.deepEqual((await b.call("/api/auth/accounts/unread")).body.accounts, []);
|
||||
await b.signIn("[email protected]", "second-password", true);
|
||||
const res = await b.call("/api/auth/accounts/unread");
|
||||
assert.equal(res.status, 200);
|
||||
assert.equal(res.body.accounts.length, 1, "only the account not in front");
|
||||
const [other] = res.body.accounts;
|
||||
const listed = (await b.accounts()).find((a) => !a.front)!;
|
||||
assert.equal(other.id, listed.id);
|
||||
assert.equal(typeof other.unread, "number", JSON.stringify(res.body));
|
||||
});
|
||||
Reference in new issue
Block a user