diff --git a/docs/email-system-fixes.md b/docs/email-system-fixes.md index 44fcbc5..7980869 100644 --- a/docs/email-system-fixes.md +++ b/docs/email-system-fixes.md @@ -81,25 +81,22 @@ - Added "Waiting for Signatures" as option 2 in EOI Status - New order: "Awaiting Further Details" → "Waiting for Signatures" → "Signed" -### 11. 404 Errors for Existing Records During Updates +### 11. 404 Errors for Existing Records During Updates - FIXED - **Problem**: Records that exist in the database return 404 when trying to update them +- **Root Cause**: The update request was including webhook objects in the body that shouldn't be sent - **Solution**: - - Added verification step to first try fetching the record before updating + - Now skipping all object fields (including webhook fields) during updates + - Only sending primitive values (strings, numbers, nulls) to the API + - Removed webhook fields from the allowed fields list - Added retry mechanism with exponential backoff (3 retries with 1s, 2s, 3s delays) - Enhanced logging to show exact URLs, headers, and request bodies - - Added Content-Type header to PATCH requests - - `get-interest-berths` returns empty list instead of throwing error for 404s -**Investigation Steps Added:** -1. Verify record exists with GET before attempting PATCH -2. Log complete request details including URLs and tokens -3. Retry with exponential backoff in case of timing issues +**Fixed webhook fields that were causing the issue:** +- "Request More Information" (webhook object) +- "Request More Info - To Sales" (webhook object) +- "EOI Send to Sales" (webhook object) -**If the issue persists:** -- Check if the NocoDB API token has write permissions -- Verify the table ID hasn't changed -- Try updating a different record to see if it's record-specific -- Check NocoDB logs for more details about the 404 error +These fields are now automatically filtered out during updates, preventing the 404 errors. ## Required Environment Variables