Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: structured stub returns, send result checking, CDP dedup TODO

Adam Eivy2ba7f39c0b29
diff --git a/client/src/components/messages/DraftsTab.jsx b/client/src/components/messages/DraftsTab.jsx
index 57786b7e9d..ad91ad39ab 100644
--- a/client/src/components/messages/DraftsTab.jsx
+++ b/client/src/components/messages/DraftsTab.jsx
@@ -27,10 +27,12 @@ export default function DraftsTab({ accounts }) {
const handleSend = async (id) => {
const result = await api.sendMessageDraft(id).catch(() => null);
- if (result) {
- setDrafts(prev => prev.map(d => d.id === id ? { ...d, status: 'sent' } : d));
- toast.success('Message sent');
+ if (!result || result.success === false) {
+ toast.error(result?.error || 'Failed to send message');
+ return;
}
+ setDrafts(prev => prev.map(d => d.id === id ? { ...d, status: 'sent' } : d));
+ toast.success('Message sent');
};
const handleDelete = async (id) => {
diff --git a/server/services/messageGmailSync.js b/server/services/messageGmailSync.js
index 93d18c5bcd..9ee83d524e 100644
--- a/server/services/messageGmailSync.js
+++ b/server/services/messageGmailSync.js
@@ -8,7 +8,7 @@ export async function syncGmail(account, cache, io) {
io?.emit('messages:sync:progress', { accountId: account.id, current: 0, total: 0 });
// TODO: Integrate with Gmail MCP when available
// The MCP bridge would call gmail.users.messages.list and gmail.users.messages.get
- return [];
+ return { messages: [], status: 'not-configured' };
}
/**
@@ -17,5 +17,5 @@ export async function syncGmail(account, cache, io) {
export async function sendGmail(account, draft) {
console.log(`📧 Gmail send for ${account.email} — MCP integration pending`);
// TODO: Integrate with Gmail MCP when available
- return { success: false, error: 'Gmail MCP not configured' };
+ return { success: false, error: 'Gmail MCP not configured', status: 501, code: 'GMAIL_MCP_NOT_CONFIGURED' };
}
diff --git a/server/services/messagePlaywrightSync.js b/server/services/messagePlaywrightSync.js
index f9e247e26d..82d2984eae 100644
--- a/server/services/messagePlaywrightSync.js
+++ b/server/services/messagePlaywrightSync.js
@@ -21,6 +21,8 @@ function makeExternalId(date, sender, subject) {
return `pw-${hash}`;
}
+// TODO: Extract shared CDP helpers (getCdpConnectHost, cdpFetch, getPages, findOrOpenPage)
+// into browserService.js to avoid duplication with existing CDP logic there
async function getCdpConnectHost() {
const config = await loadConfig();
const host = (config.cdpHost === '0.0.0.0' || config.cdpHost === '::') ? '127.0.0.1' : config.cdpHost;
@@ -222,7 +224,7 @@ function buildExtractionScript(type, sels) {
*/
export async function sendPlaywright(account, draft) {
console.log(`📧 Playwright send for ${account.email} (${account.type}) — automation pending`);
- return { success: false, error: 'Playwright send not yet implemented' };
+ return { success: false, error: 'Playwright send not yet implemented', status: 501, code: 'NOT_IMPLEMENTED' };
}
/**