toga-ai 1.0.934 → 1.0.935
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -64,7 +64,7 @@ a **daily batch import** of supporting records. A separate 2-minute cron bridges
|
|
|
64
64
|
`crons/toga2/wje/sync_togasupply_wje.php` (2-min Togadesk bridge),
|
|
65
65
|
`crons/notifications/reports/wje/{wje_monthly_report,wje_quarterly_report,wje_common}.php`.
|
|
66
66
|
- **Models:** `_underscore/Model/Wje/*` (8 classes, see Data model).
|
|
67
|
-
- **Monitoring:** `library/app/systemmonitor/wje.php` (`App_SystemMonitor_WJE`, Freshservice/webhook errors); `worker2/Worker/Monitor/Wje.php` ([WJE OneUptime monitor suite](../../../../clients/wje/features/oneuptime-monitors.md): webhook → 2.0, TOGaDesk → 2.0, 2.0 → TOGaDesk).
|
|
67
|
+
- **Monitoring:** `library/app/systemmonitor/wje.php` (`App_SystemMonitor_WJE`, Freshservice/webhook errors); `worker2/Worker/Monitor/Wje.php` ([WJE OneUptime monitor suite](../../../../clients/wje/features/oneuptime-monitors.md): webhook → 2.0, TOGaDesk → 2.0, 2.0 → TOGaDesk, TOGaDesk/2.0 → Freshservice).
|
|
68
68
|
|
|
69
69
|
### Real-time webhook (`_Worker_Wje::Webhook`)
|
|
70
70
|
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
|
|
3
3
|
| Doc | Framework | Summary |
|
|
4
4
|
|-----|-----------|---------|
|
|
5
|
-
| [WJE: OneUptime monitor suite (Monitor/Wje — TicketWritesToToga2, TicketSyncToTogadesk, WebhookTicketSync)](features/oneuptime-monitors.md) | 2.0 |
|
|
5
|
+
| [WJE: OneUptime monitor suite (Monitor/Wje — TicketWritesToToga2, TicketSyncToTogadesk, WebhookTicketSync, TicketTransmissionToFreshservice)](features/oneuptime-monitors.md) | 2.0 | Four worker2 OneUptime push monitors on the WJE ticket flow (Freshservice webhook → TOGa 2, TOGaDesk → TOGa 2, TOGa 2 → TOGaDesk, TOGaDesk/TOGa 2 → Freshservice |
|
|
6
6
|
| [Wiss, Janney, Elstner Associates, Inc.](profile.md) | 2.0 | WJE (Wiss, Janney, Elstner / "WJE IT") Freshservice help-desk client, single hardcoded tenant; open for the three sync paths, the TOGaDesk bridge ids/department |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "WJE: OneUptime monitor suite (Monitor/Wje — TicketWritesToToga2, TicketSyncToTogadesk, WebhookTicketSync)"
|
|
2
|
+
title: "WJE: OneUptime monitor suite (Monitor/Wje — TicketWritesToToga2, TicketSyncToTogadesk, WebhookTicketSync, TicketTransmissionToFreshservice)"
|
|
3
3
|
framework: "2.0"
|
|
4
4
|
repo: worker2
|
|
5
5
|
project: Worker
|
|
@@ -14,33 +14,36 @@ files:
|
|
|
14
14
|
- dbchanges2/Core/2026-09-30b - Insert WJE Ticket Writes Monitor CronJob.sql
|
|
15
15
|
- dbchanges2/Core/2026-10-01a - Insert WJE Ticket Sync To TOGaDesk Monitor CronJob.sql
|
|
16
16
|
- dbchanges2/Core/2026-10-01b - Insert WJE Freshservice Webhook Sync Monitor CronJob.sql
|
|
17
|
+
- dbchanges2/Core/2026-10-01c - Insert WJE Ticket Transmission To Freshservice Monitor CronJob.sql
|
|
17
18
|
- worker/crons/toga2/wje/sync_togasupply_wje.php
|
|
18
19
|
- library/app/api/toga2.php
|
|
20
|
+
- library/app/systemmonitor/wje.php
|
|
19
21
|
related:
|
|
20
22
|
- ../../../2.0/apps/worker2/features/oneuptime-worker2-monitoring.md
|
|
21
23
|
- ../../../1.0/apps/library/features/toga2-api-client-and-bridge.md
|
|
22
24
|
- ../../../2.0/apps/worker2/features/wje-freshservice-sync.md
|
|
23
25
|
- ../profile.md
|
|
24
26
|
---
|
|
25
|
-
|
|
27
|
+
Four worker2 OneUptime push monitors on the WJE ticket flow (Freshservice webhook → TOGa 2, TOGaDesk → TOGa 2, TOGa 2 → TOGaDesk, TOGaDesk/TOGa 2 → Freshservice); open when working on WJE monitoring, its parameters, activation, or clearing a stuck ticket.
|
|
26
28
|
|
|
27
29
|
## Summary
|
|
28
|
-
`_Worker_Monitor_Wje` (`worker2/Worker/Monitor/Wje.php`) holds
|
|
30
|
+
`_Worker_Monitor_Wje` (`worker2/Worker/Monitor/Wje.php`) holds four actions, one per hop. All follow the shared [OneUptime push-metric pattern](../../../2.0/apps/worker2/features/oneuptime-worker2-monitoring.md) — payload contract, criteria, provisioning live there.
|
|
29
31
|
|
|
30
32
|
| Action | Ticket | Hop | OneUptime monitor name | Cron |
|
|
31
33
|
|---|---|---|---|---|
|
|
32
34
|
| `Monitor/Wje/WebhookTicketSync` | TRUE-80520 | Freshservice webhook → `Client_Wje.Tickets` | "WJE Freshservice Webhook Sync" | 5 min, max 120s |
|
|
33
35
|
| `Monitor/Wje/TicketWritesToToga2` | TRUE-80523 | TOGaDesk dept 269 → TOGa 2 | "WJE Ticket Writes to TOGa 2" | 5 min |
|
|
34
36
|
| `Monitor/Wje/TicketSyncToTogadesk` | TRUE-80521 | TOGa 2 → TOGaDesk | "WJE Ticket Sync to TOGaDesk" | 5 min, max 300s |
|
|
37
|
+
| `Monitor/Wje/TicketTransmissionToFreshservice` | TRUE-80522 | TOGaDesk / TOGa 2 → WJE Freshservice | "WJE Ticket Transmission to Freshservice" | 5 min, max 120s |
|
|
35
38
|
|
|
36
|
-
- **Status 2026-10-01:** all
|
|
39
|
+
- **Status 2026-10-01:** all four committed on the one shared branch `TRUE-80523` (worker2, dbchanges2, worker comment), **not deployed**. Seeds ship `isActive = 0`. Push URLs are credentials — never record them.
|
|
37
40
|
- DBs: `TOGaDeskSupport` via `_underscore::DB_TOGADESK1` (legacy); `Client_Wje` via `_Worker_Client_Wje::DB_CLIENT_WJE` (`worker2/Worker/Client/Wje.php`, mirrors `Client/Prudential.php`, registered in `initialize()`); `Logs` via `_underscore::DB_LOGS` (registered per job in worker2 `Controller/Index.php`). Each query stays in one DB family; compare in PHP.
|
|
38
41
|
- DB failures go through `reportQueryFailure(array $params)` → `status: error` with **only** `errorClass` + `errorNumber` (the message can hold SQL, host, user).
|
|
39
42
|
|
|
40
43
|
## How it works
|
|
41
44
|
|
|
42
45
|
### Why backlogs, not checkpoint freshness
|
|
43
|
-
The TOGaDesk bridge catches a per-ticket exception → Sentry only, and **still advances its checkpoint** (`TOGA_LAST_TICKET_INTEGRATION_DATETIME` / `TOGADESK_LAST_TICKET_INTEGRATION_DATETIME`). A failed ticket is never retried unless touched again, so a checkpoint-age check reads healthy. All
|
|
46
|
+
The TOGaDesk bridge catches a per-ticket exception → Sentry only, and **still advances its checkpoint** (`TOGA_LAST_TICKET_INTEGRATION_DATETIME` / `TOGADESK_LAST_TICKET_INTEGRATION_DATETIME`). A failed ticket is never retried unless touched again, so a checkpoint-age check reads healthy. All four monitors look for rows that should exist on the far side and do not (link model: [bridge doc](../../../1.0/apps/library/features/toga2-api-client-and-bridge.md)).
|
|
44
47
|
|
|
45
48
|
### TicketWritesToToga2 (TOGaDesk → TOGa 2)
|
|
46
49
|
- Counts WJE rows (`tickets.clientid = 153`) in `tickets`, `tickets_replies`, `comments` with `referenceId` NULL or `''`, created on/after `BACKLOG_CUTOFF_DATE = '2025-05-01'`, in `departmentIds`, minus `excludedTicketNumbers`.
|
|
@@ -65,20 +68,34 @@ The TOGaDesk bridge catches a per-ticket exception → Sentry only, and **still
|
|
|
65
68
|
- Silence (`minutesSinceLastWebhook`) is reported, **never alarmed** — long quiet spells are normal (see Gotchas).
|
|
66
69
|
- Params: `{"alertThresholdMinutes":30,"lookbackHours":24,"maxScannedWebhookRows":20000,"excludedTicketNumbers":[]}`; PHP defaults are the `DEFAULT_WEBHOOK_*` / `DEFAULT_MAX_SCANNED_WEBHOOK_ROWS` constants.
|
|
67
70
|
|
|
71
|
+
### TicketTransmissionToFreshservice (TOGaDesk / TOGa 2 → Freshservice)
|
|
72
|
+
- **Sends happen only in 1.0** `App_Api_Toga2::syncTogaDesk1TicketIntoToga2Ticket` (`library/app/api/toga2.php`). `App_Api_Wje::send` throws on non-200/201.
|
|
73
|
+
- New TOGaDesk ticket → `POST /tickets` only when `$isWjeUuid && !empty($togadeskPerson->referenceId)` (~L12133-12174). Freshservice id saved on 2.0 `Tickets.c_wjeTicketId`.
|
|
74
|
+
- TOGaDesk reply on a ticket with `c_wjeTicketId` → `POST /tickets/{id}/reply` (~L12298). Id saved on 2.0 `TicketNotes.c_wjeConversationId` (~L12469).
|
|
75
|
+
- Status/field change → `PUT /tickets/{id}` (~L12775-12877). **Nothing is saved** → blind spot (see Gotchas).
|
|
76
|
+
- Internal comments are never sent (that code is commented out).
|
|
77
|
+
- Check 1 (new tickets): TOGaDesk tickets (`clientid = 153`, in `departmentIds`) since `FRESHSERVICE_TRANSMISSION_CUTOFF_DATE = '2026-10-01'`, `>= alertThresholdMinutes` old, `people.referenceId` set, `tickets.referenceId` set → read 2.0 `Tickets` by uuid. Present with no `c_wjeTicketId` → `HIGH`. Uuid absent from 2.0 is `TicketWritesToToga2`'s job — not counted here.
|
|
78
|
+
- Check 2 (replies): 2.0 external `TicketNotes` on tickets with `c_wjeTicketId`, since the cutoff, `>= alertThresholdMinutes` old, no `c_wjeConversationId` → `HIGH`.
|
|
79
|
+
- Requester rule = the TOGaDesk link (`people.referenceId`), **not** the 2.0 contact's `c_wjeUserId` — the monitor follows what the sync does (see Gotchas).
|
|
80
|
+
- `lateTicketNumbers` labels: `TD-<togadesk number>` (new ticket) / `WJE-<freshservice number>` (reply). One `excludedTicketNumbers` list serves both — the ranges cannot overlap (TOGaDesk WJE numbers start `153000001`; Freshservice ~66,000 in 2026).
|
|
81
|
+
- Params: `{"alertThresholdMinutes":15,"departmentIds":[269],"excludedTicketNumbers":[]}`. Same empty-`departmentIds` → `status: error` rule as `TicketWritesToToga2` (DB row is the only home of the list).
|
|
82
|
+
- **Clear a late one:** fix the cause, then create the ticket in Freshservice by hand and save its id to 2.0 `c_wjeTicketId` — or add the number to `excludedTicketNumbers`. Touching the ticket does **not** retry a lost POST (see Gotchas).
|
|
83
|
+
|
|
68
84
|
### Clear a stuck ticket (runbook)
|
|
69
85
|
1. Fix the cause (Sentry has the exception).
|
|
70
86
|
2. Touch the ticket (add a reply/note) so the sync picks it up again — or move the checkpoint back.
|
|
71
87
|
3. If abandoning it, add its ticket number to that monitor's `excludedTicketNumbers`.
|
|
72
88
|
|
|
73
|
-
### Activation (in order, all
|
|
89
|
+
### Activation (in order, all four)
|
|
74
90
|
1. Push branch `TRUE-80523` (worker2, dbchanges2, worker).
|
|
75
91
|
2. Deploy worker2.
|
|
76
|
-
3. Run the Core seeds in order: `2026-09-30b`, `2026-10-01a`, `2026-10-01b`.
|
|
77
|
-
4. Create the
|
|
92
|
+
3. Run the Core seeds in order: `2026-09-30b`, `2026-10-01a`, `2026-10-01b`, `2026-10-01c`.
|
|
93
|
+
4. Create the four OneUptime Incoming Request monitors with **body rules only**: Contains `"alarm":"HIGH"` → Offline; Contains `"status":"error"` → Offline; Contains `"alarm":"OK"` → Online. Put each push URL in its job config (never in a doc).
|
|
78
94
|
5. Test `TicketWritesToToga2`: set `departmentIds` to `[290]` (has old unsent rows), hand-run → expect HIGH. Restore `[269]`, hand-run → expect recovery.
|
|
79
|
-
6. Hand-run the other
|
|
80
|
-
7. Set `isActive = 1` on all
|
|
95
|
+
6. Hand-run the other three → expect OK.
|
|
96
|
+
7. Set `isActive = 1` on all four.
|
|
81
97
|
8. Only then add the Not Received 10/15 min rules (see the activation-ordering trap in the shared doc).
|
|
98
|
+
9. Tell the team `TicketTransmissionToFreshservice` may go HIGH on the next TOGaDesk-created ticket with a linked requester — a real failure, not noise (see Gotchas).
|
|
82
99
|
|
|
83
100
|
## Gotchas
|
|
84
101
|
- **Dept 269 is very low volume** (Sept 2026: 3 tickets, 7 replies, 2 comments). "No writes" is normal.
|
|
@@ -93,7 +110,13 @@ The TOGaDesk bridge catches a per-ticket exception → Sentry only, and **still
|
|
|
93
110
|
- **Query cost (prod, verified, all fine at 5 min):** `TOGaDeskSupport` has **no index on `referenceId`** (`tickets`: clientid etc.; `tickets_replies`: `ticketid`; `comments`: PRIMARY only, ~13k-row full scan). `Client_Wje.TicketNotes` ~7.3k-row full scan; `Tickets.c_wjeTicketId` not indexed. Legacy `wait_timeout` 900s (covers the 150s sleep).
|
|
94
111
|
- **Blind spots:**
|
|
95
112
|
- `TicketWritesToToga2`: field-only edits (priority/assignee) on a linked ticket create no row. Status changes are covered (they arrive as replies).
|
|
113
|
+
- `TicketTransmissionToFreshservice`: status/field `PUT`s save nothing, so a failed one is invisible here. Partial cover: the 1.0 client logs the Freshservice error and `App_SystemMonitor_WJE` (`library/app/systemmonitor/wje.php`) emails it — **not verified** that it fires for these `PUT`s.
|
|
96
114
|
- `WebhookTicketSync`: webhooks WJE never sends; note sync inside the webhook; forged numeric posts to the public `/wje` route can raise a false HIGH (whether the ingestion Lambda verifies the sender is unchecked).
|
|
115
|
+
- **0 of 19 TOGaDesk-created WJE tickets ever reached Freshservice** (`153000001`–`153000022`, since 2024-11): 11 `@8x8.com` phone-system requesters not linked (skipped by design), 7 internal/test (`@goagilant.com` / `@togatech.com`), **3 linked `@wje.com` requesters unsent** (`153000016` 2025-10-04, `153000021` 2026-08-08, `153000022` 2026-08-21). Hence the 2026-10-01 cutoff. **Not being investigated (Mark's call — new/future only).**
|
|
116
|
+
- **Likely permanent-loss path (CTO code reading, unproven):** Freshservice `POST` throws after the 2.0 ticket exists → next run finds the 2.0 ticket by number, takes the "already exists" branch (which never POSTs), saves the TOGaDesk `referenceId` → never retried, never alerted. Expect the monitor to go HIGH on the next linked TOGaDesk-created ticket.
|
|
117
|
+
- **2.0 contact `c_wjeUserId` does not mirror the TOGaDesk link** — `153000021`/`22` requesters are linked in 1.0 but their 2.0 contact has no `c_wjeUserId`. Do not switch the monitor to the 2.0 field.
|
|
118
|
+
- **Replies are healthy:** 0 of ~1,400 external notes on WJE-linked tickets since 2026-05 lack `c_wjeConversationId`.
|
|
119
|
+
- **Known risk, no monitor (out of scope):** if the reply `POST` succeeds but the 2.0 note write fails, the next run sends the reply to WJE again (duplicate).
|
|
97
120
|
- **The ClickUp TRUE-80523 description is fabricated** (Talos auto-generated) — see [MCP tool usage gotcha](../../../standalone/apps/claude/workflows/mcp-tool-usage.md). Trust this doc and the code.
|
|
98
121
|
|
|
99
122
|
## Related
|
|
@@ -103,5 +126,6 @@ The TOGaDesk bridge catches a per-ticket exception → Sentry only, and **still
|
|
|
103
126
|
- [WJE profile](../profile.md)
|
|
104
127
|
|
|
105
128
|
## Change history
|
|
129
|
+
- 2026-10-01 — Added `TicketTransmissionToFreshservice` (TRUE-80522) on the shared branch; recorded the 19-ticket never-sent finding and the likely permanent-loss path. Not deployed. (mhammontree)
|
|
106
130
|
- 2026-10-01 — Renamed from `oneuptime-ticket-writes-monitor.md` to the suite doc; added `TicketSyncToTogadesk` (TRUE-80521) and `WebhookTicketSync` (TRUE-80520). Not deployed. (mhammontree)
|
|
107
131
|
- 2026-10-01 — Created: `TicketWritesToToga2` built on branch TRUE-80523, not deployed, cron `isActive = 0`. (mhammontree)
|
|
@@ -38,7 +38,7 @@ Data moves between WJE and TOGA on three paths:
|
|
|
38
38
|
2. **Daily batch import** (`worker/crons/toga2/wje/import_supporting_records.php`) — imports canned responses, requesters, assets, groups, and the 3-level category hierarchy.
|
|
39
39
|
3. **2-minute TOGaDesk bridge** (`App_Api_Toga2::syncWithTogadesk`) — the cron `worker/crons/toga2/wje/sync_togasupply_wje.php` enables the **full** set of bridge sub-syncs (tickets both directions, ticket-notes, contacts→people, items/units→assets, predefined-replies, ticket-teams→groups, ticket-categories) for TOGaDesk client id 153. **TOGaDesk → 2.0 syncs department 269 only.**
|
|
40
40
|
|
|
41
|
-
Monitoring: [OneUptime monitor suite](./features/oneuptime-monitors.md) —
|
|
41
|
+
Monitoring: [OneUptime monitor suite](./features/oneuptime-monitors.md) — four backlog monitors, one per hop (webhook → 2.0, TOGaDesk dept 269 → 2.0, 2.0 → TOGaDesk, TOGaDesk/2.0 → Freshservice).
|
|
42
42
|
|
|
43
43
|
Webhook behavior: WJE turns OFF new-ticket webhooks 8am–6pm on their workday (TOGA covers after-hours); updates still arrive by day. WJE sends only a subset of its Freshservice tickets (rule unknown).
|
|
44
44
|
|
|
@@ -53,4 +53,4 @@ Webhook behavior: WJE turns OFF new-ticket webhooks 8am–6pm on their workday (
|
|
|
53
53
|
|
|
54
54
|
- **[wje-freshservice-sync](../../2.0/apps/worker2/features/wje-freshservice-sync.md)** — full integration: webhook handler, import cron, `c_wje*` models, API clients, schema, reports, gotchas.
|
|
55
55
|
- **[toga2-api-client-and-bridge](../../1.0/apps/library/features/toga2-api-client-and-bridge.md)** — the `syncWithTogadesk` bridge mechanism.
|
|
56
|
-
- **[oneuptime-monitors](./features/oneuptime-monitors.md)** — the
|
|
56
|
+
- **[oneuptime-monitors](./features/oneuptime-monitors.md)** — the four WJE OneUptime monitors.
|
package/package.json
CHANGED