> For the complete documentation index, see [llms.txt](https://docs.xenoraa.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.xenoraa.com/xenoraa-changelog-and-architecture/sentry-issues-fixed-july-17-2026.md).

# Sentry Issues Fixed — July 17, 2026

## Sentry Issues Fixed — July 17, 2026

This document records all Sentry issues that were identified, diagnosed, and resolved on July 17, 2026. All 6 unresolved issues in the Xenoraa Sentry project (organization: `esscay`) were fixed in a single deployment (commit `8cb6d89` on the `main` branch).

### Summary

| Issue ID  | Title                                            | Root Cause                                                             | Fix Applied                                                                          |
| --------- | ------------------------------------------------ | ---------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| XENORAA-1 | Test exception from Sentry Laravel SDK           | Test exception, not a real error                                       | Marked resolved                                                                      |
| XENORAA-2 | Cron failure: xenoraa-notification-reminders     | Missing `sentryMonitor()` call in `Kernel.php`                         | Added `->sentryMonitor('xenoraa-notification-reminders')` to schedule                |
| XENORAA-3 | SyntaxError: Unexpected end of input (dashboard) | `r.json()` called on non-200 HTTP response in alerts fetch             | Added `r.ok` guard before `r.json()` in `dashboard.blade.php`                        |
| XENORAA-4 | SyntaxError: Unexpected token `}` (dashboard)    | `r.json()` called on non-200 HTTP response in dashboard-insights fetch | Added `r.ok` guard before `r.json()` in `dashboard.blade.php`                        |
| XENORAA-5 | TypeError: ServiceWorker script fetch failed     | Service worker intercepting admin AJAX calls                           | Added `/admin/` route bypass in `public/sw.js`                                       |
| XENORAA-6 | TypeError: appendChild — deals kanban drag-drop  | Fetch URL pointed to non-existent route `/admin/deals/{id}/stage`      | Fixed URL to `/admin/crm2/sales/deals/{id}/stage`, added controller method and route |

### Detailed Fix Notes

#### XENORAA-2: Cron Failure (Notification Reminders)

The `xenoraa:send-notification-reminders` command runs every 30 minutes via the Laravel scheduler. It was not registered with Sentry's cron monitoring, causing Sentry to report it as a failure. The fix was to add `->sentryMonitor('xenoraa-notification-reminders')` to the schedule definition in `app/Console/Kernel.php`.

#### XENORAA-3 & XENORAA-4: Dashboard SyntaxErrors

The dashboard page makes two fetch calls — one to `/admin/xena/dashboard-insights` and one to `/admin/xena/alerts`. When these endpoints return a non-200 HTTP response (e.g., 401 when session expires), the code was calling `.json()` on the response without checking `response.ok` first. This caused a SyntaxError because the response body was an HTML error page, not valid JSON. The fix adds an `if (!r.ok) throw new Error(...)` check before calling `.json()`.

#### XENORAA-5: Service Worker Fetch Interception

The service worker (`public/sw.js`) was intercepting fetch requests made from admin pages. While it correctly bypassed requests with the `X-Requested-With: XMLHttpRequest` header, some admin fetch calls (like the deals kanban PATCH) did not include this header. The fix adds an explicit bypass for all requests to URLs containing `/admin/`, ensuring the service worker never intercepts admin API calls.

#### XENORAA-6: Deals Kanban Drag-and-Drop (TypeError appendChild)

The deals kanban board (`/admin/crm2/sales/deals`) allows dragging deal cards between pipeline stages. The JavaScript `onDrop` handler was making a `PATCH` request to `/admin/deals/{id}/stage`, which did not exist. The 404 response was not valid JSON, causing `r.json()` to throw an error. This error then caused `_dragCard` to become null before the revert logic could call `appendChild`, resulting in the TypeError.

Three changes were made to fix this:

1. The fetch URL in `deals.blade.php` was corrected to `/admin/crm2/sales/deals/{id}/stage`.
2. A new `salesDealsStageUpdate()` method was added to `CrmModuleController.php` to handle the request and return a proper JSON response.
3. A new `PATCH /admin/crm2/sales/deals/{id}/stage` route was registered in `routes/web.php`.

### Files Changed

* `routes/web.php` — Added `PATCH /admin/crm2/sales/deals/{id}/stage` route
* `app/Http/Controllers/Admin/CrmModuleController.php` — Added `salesDealsStageUpdate()` method
* `resources/views/admin/crm2/sales/deals.blade.php` — Fixed drag-drop fetch URL
* `resources/views/admin/dashboard.blade.php` — Added `r.ok` guards on both fetch calls
* `app/Console/Kernel.php` — Added `sentryMonitor` to notification-reminders schedule
* `public/sw.js` — Added admin route bypass to service worker fetch handler


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.xenoraa.com/xenoraa-changelog-and-architecture/sentry-issues-fixed-july-17-2026.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
