sync: auto-sync from GURU-5070 at 2026-05-24 12:10:30

Author: Mike Swanson
Machine: GURU-5070
Timestamp: 2026-05-24 12:10:30
This commit is contained in:
2026-05-24 12:10:35 -07:00
parent 04f70c953c
commit 64994688db
2 changed files with 90 additions and 1 deletions

View File

@@ -657,3 +657,92 @@ None. All specifications created, roadmap updated, and changes committed.
- 5 specification files (2,058 lines)
- All specs sprint-ready with database schemas, API endpoints, security threat models
- Roadmap updated with links to all specifications
---
## Update: ~19:30 PT — Dashboard interrupted badge fix + verification
### User
- **User:** Mike Swanson (mike)
- **Machine:** DESKTOP-0O8A1RL (GURU-5070)
- **Role:** admin
### Session Summary
Resumed from a context-compacted session. Primary goal: verify that the `interrupted` command status renders with an amber AlertTriangle badge on the GuruRMM Commands page (feature shipped in `aa9ad74`). This required building and deploying the dashboard separately, since `build-agents.sh` does not run `npm run build` — it only version-bumps `package.json`.
First deployment built bundle `index-DVBCLMO0.js` but the amber badge did not render. Browser inspection showed the React fiber for Badge had no `className` prop at all, meaning `STATUS_BADGE_CLASSES["interrupted"]` returned `undefined` at runtime despite the key existing in the minified bundle. The amber CSS classes were present in the stylesheet and worked when manually injected via DevTools, ruling out Tailwind purging. Root cause was not fully determined — most likely a Vite/Rollup optimization of the module-scope const object.
A prior session attempt to apply a workaround via SSH Python heredoc failed (shell stripped all double-quote characters from the script, producing invalid TypeScript). In this session the fix was applied using the local Edit tool on the stale submodule (`D:\claudetools\projects\msp-tools\guru-rmm`): replaced `STATUS_BADGE_CLASSES` Record const + lookup with an explicit `getStatusBadgeClass()` function using if/else chains. Committed as `d734b18`, pulled on server, rebuilt (bundle `index-Koq4UVgV.js`), deployed. Browser verification confirmed the amber AlertTriangle icon and amber "interrupted" badge render correctly. Test DB row cleaned up.
Pluto (172.16.3.36) remained unreachable throughout the session — Windows agent builds for `789fcfc` (AgentEvent import fix) and `d734b18` (dashboard-only) remain pending until the VM comes back online.
### Key Decisions
- **Explicit if/else function over Record lookup**: `STATUS_BADGE_CLASSES[cmd.status]` returned `undefined` for `"interrupted"` at runtime despite correct source. Replacing with an explicit `getStatusBadgeClass()` function is immune to any minifier/closure issue and makes the behavior unambiguous.
- **Local Edit + git push over SSH heredoc**: Prior attempt to write TypeScript via SSH Python heredoc failed due to shell quote stripping. Correct pattern: edit locally in the stale submodule, push to Gitea, pull on server, rebuild.
- **Also removed the multi-line JSDoc comment** above the function — it referenced the old const name and adds no value.
### Problems Encountered
- **`STATUS_BADGE_CLASSES["interrupted"]` returned undefined at runtime**: Bundle contained the correct object with all 6 keys. React fiber showed Badge receiving no `className` prop. Fixed by replacing with explicit function (`d734b18`).
- **TypeScript build blocked by unused AgentEvent import**: `AgentDetail.tsx` imported `AgentEvent` but never used it (TS6133). Fixed via `sed` on server, committed as `789fcfc`.
- **Git push rejected (server behind origin)**: Server's local branch was behind CI auto-bump commits. Fixed with `git pull --rebase origin main && git push`.
- **Local submodule 6 commits behind remote**: Stale submodule needed `git stash && git pull --rebase origin main` before applying the fix.
- **Pluto unreachable (100% packet loss)**: Windows VM on Jupiter went offline mid-session. Windows agent builds blocked. No resolution — requires manual check of Jupiter/Unraid console.
- **PostgreSQL peer auth**: `psql -U gururmm` fails locally; use `PGPASSWORD=... psql -h localhost -U gururmm -d gururmm` for TCP.
- **Unresolved merge conflict in this session log file**: Conflict between GURU-KALI (10:15 MST update) and MacBook (10:45 PT update) was present in the file on disk. Resolved by keeping both sections and removing conflict markers.
### Configuration Changes
- `dashboard/src/pages/Commands.tsx` — replaced `STATUS_BADGE_CLASSES` Record const with `getStatusBadgeClass()` explicit function; removed stale JSDoc comment (commit `d734b18`)
- `/var/www/gururmm/dashboard/assets/` on 172.16.3.30 — replaced `index-DVBCLMO0.js` / `index-akGnykc6.css` with `index-Koq4UVgV.js` / `index-BPcJRrHX.css`
- `session-logs/2026-05-24-session.md` — resolved merge conflict, appended this update
### Credentials & Secrets
- **GuruRMM PostgreSQL:** `PGPASSWORD=43617ebf7eb242e814ca9988cc4df5ad` — host `localhost` (TCP), user `gururmm`, db `gururmm`
### Infrastructure & Servers
- **GuruRMM server:** 172.16.3.30 — dashboard webroot `/var/www/gururmm/dashboard/`
- **Gitea:** 172.16.3.20:3000 — repo `azcomputerguru/gururmm`
- **Dashboard:** https://rmm.azcomputerguru.com
- **Pluto:** 172.16.3.36 — Windows Server 2019 VM on Jupiter (Unraid); unreachable as of session end
### Commands & Outputs
```bash
# Build dashboard on server
cd /home/guru/gururmm/dashboard && sudo -u guru npm run build
# Output: dist/assets/index-Koq4UVgV.js 1,267.46 kB | gzip: 348.14 kB — built in 10.84s
# Deploy to webroot
sudo rsync -av --delete /home/guru/gururmm/dashboard/dist/ /var/www/gururmm/dashboard/
# Replaced: index-DVBCLMO0.js -> index-Koq4UVgV.js
# Verify explicit function in new bundle
grep -oP '.{30}interrupted.{60}' /var/www/gururmm/dashboard/assets/index-Koq4UVgV.js | grep amber
# Output: ...e==="interrupted"?"border-transparent bg-amber-500/15 text-amber-700 dark:te...
# Delete test DB row
PGPASSWORD=43617ebf7eb242e814ca9988cc4df5ad psql -h localhost -U gururmm -d gururmm \
-c "DELETE FROM commands WHERE id = 'e19470f0-efbd-4f6d-b5f9-98f8b19cb6f4';"
# Output: DELETE 1
```
### Pending / Incomplete Tasks
- **Pluto Windows build**: VM unreachable; Windows agent build for commits `789fcfc` and `d734b18` pending. Check Jupiter/Unraid console. `d734b18` is dashboard-only and doesn't require a new agent binary.
- **`ohw.rs` pub(crate) fix validation on Windows**: Commit `81dad27` fixes Rust E0364 for LHM_RUNNING. Needs Pluto build to confirm.
- **Mac session lock on `server/src/mspbackups`**: Phase 1 MSPBackups features (storage threshold alerts + agent mapping table) in progress on Mikes-MacBook-Air. Lock expires 2026-05-24T20:54:33.
### Reference Information
- **Commits:**
- `81dad27` — fix(agent): use pub(crate) for LHM_RUNNING re-export
- `789fcfc` — fix(dashboard): remove unused AgentEvent import broke tsc build
- `d734b18` — fix(dashboard): replace STATUS_BADGE_CLASSES lookup with explicit function
- **Stale submodule for local edits:** `D:\claudetools\projects\msp-tools\guru-rmm` (remote: http://172.16.3.20:3000/azcomputerguru/gururmm.git)
- **Dashboard webroot on server:** `/var/www/gururmm/dashboard/`
- **Dashboard source on server:** `/home/guru/gururmm/dashboard/`