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

fix(messages): gracefully handle Outlook delete when message already removed

Adam Eivy3054b1816b70
diff --git a/.changelog/NEXT.md b/.changelog/NEXT.md
index 49d9337591..c87fa7cea9 100644
--- a/.changelog/NEXT.md
+++ b/.changelog/NEXT.md
@@ -16,6 +16,7 @@
- Months view shows decade-per-row with flex-wrap (no horizontal scrolling)
## Fixed
+- Outlook email delete no longer throws 500 error when message was already deleted in Outlook (gracefully cleans up local cache instead)
- Life Calendar: birthdays and holidays now visible on Week view (fixed time-of-day offset bug and cross-birthday-boundary event mapping)
- Life Calendar: holidays now shown on Month view with event type coloring
- Life Calendar: Year view no longer applies birthday/holiday coloring since every cell contains both
diff --git a/server/services/messageActions.js b/server/services/messageActions.js
index 692475002f..f250e777c4 100644
--- a/server/services/messageActions.js
+++ b/server/services/messageActions.js
@@ -132,7 +132,7 @@ async function executeOutlookAction(page, subject, action) {
// Step 1: Find and click the message row using evaluateOnPage
const selectScript = `(async () => {
const listbox = document.querySelector("[role='listbox']");
- if (!listbox) return { error: 'No message list found' };
+ if (!listbox) return { notInInbox: true, error: 'No message list found' };
const target = ${JSON.stringify(subject)}.toLowerCase();
const scrollContainer = listbox.closest('[role="region"]') || listbox.parentElement;
function findMatch() {