mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-03 08:06:59 +00:00
fix: sync only the primary account's collections by default #34
The settings chooser and the reminder filter treat only the capability's primary account as the user's own, while the engine also counted any account the server marks as personal. On a server that lists a second such account, its address books and calendars synced although the chooser showed them off. The engine now uses the same rule as the app.
This commit is contained in:
@@ -297,6 +297,19 @@ describe('JMAP side', () => {
|
||||
expect(accountsWithCapability(session, JMAP_CALENDARS).map((a) => a.id)).toEqual(['a']);
|
||||
});
|
||||
|
||||
it("counts only the capability's primary account as personal, like the app's chooser", () => {
|
||||
const server = new FakeJmapServer();
|
||||
server.addAccount('a', { name: 'alice@example.com' });
|
||||
// Another account the server calls personal (a second mailbox of the same login, say).
|
||||
server.addAccount('home', { name: 'alice-home@example.com', isPersonal: true });
|
||||
const session = server.port().session();
|
||||
|
||||
expect(accountsWithCapability(session, JMAP_CONTACTS).map((a) => [a.id, a.primary, a.personal])).toEqual([
|
||||
['a', true, true],
|
||||
['home', false, false],
|
||||
]);
|
||||
});
|
||||
|
||||
it('takes the login as the owner address and survives a server without identities', async () => {
|
||||
const server = new FakeJmapServer();
|
||||
server.addAccount('a', { name: 'Alice@Example.com' });
|
||||
|
||||
Reference in New Issue
Block a user