Refractoring Stage 5 Moved the OpenPGP and DAV IPC handlers into desktop/ipc/pgp.cjs and desktop/ipc/dav.cjs.

This commit is contained in:
2026-10-16 17:38:48 +03:00
parent 928e6dd62a
commit 52f7001b34
9 changed files with 673 additions and 459 deletions
+8 -2
View File
@@ -71,8 +71,14 @@ test('prevents renderer-supplied raw SMTP messages while accepting standard comp
test('every registered main-process IPC handler has a request schema', () => {
const mainPath = path.resolve(__dirname, '..', 'desktop', 'main.cjs');
const source = fs.readFileSync(mainPath, 'utf8');
const channels = [...source.matchAll(/registerIpcHandler\('([^']+)'/g)].map(match => match[1]);
const ipcDirectory = path.resolve(__dirname, '..', 'desktop', 'ipc');
const sourceFiles = [mainPath, ...fs.readdirSync(ipcDirectory)
.filter(name => name.endsWith('.cjs'))
.map(name => path.join(ipcDirectory, name))];
const channels = sourceFiles.flatMap(file => {
const source = fs.readFileSync(file, 'utf8');
return [...source.matchAll(/registerIpcHandler\('([^']+)'/g)].map(match => match[1]);
});
assert.ok(channels.length > 0);
for (const channel of channels) {
assert.equal(hasIpcSchema(channel), true, `missing IPC request schema: ${channel}`);