[dev] [carhartlewis] lewis/comp-device-agent-overhaul#2115
[dev] [carhartlewis] lewis/comp-device-agent-overhaul#2115github-actions[bot] wants to merge 15 commits intomainfrom
Conversation
PR SummaryMedium Risk Overview Updates the API Revamps the app’s People area to surface device-agent data end-to-end: introduces Written by Cursor Bugbot for commit 493f881. This will update automatically on new commits. Configure here. |
apps/app/src/app/(app)/[orgId]/people/devices/components/EmployeeDevicesColumns.tsx
Show resolved
Hide resolved
apps/app/src/app/(app)/[orgId]/people/devices/components/EmployeeDevicesList.tsx
Outdated
Show resolved
Hide resolved
apps/portal/src/app/(app)/(home)/[orgId]/components/EmployeeTasksList.tsx
Outdated
Show resolved
Hide resolved
apps/app/src/app/(app)/[orgId]/people/dashboard/components/EmployeeCompletionChart.tsx
Outdated
Show resolved
Hide resolved
apps/app/src/app/(app)/[orgId]/people/devices/components/EmployeeDevicesList.tsx
Show resolved
Hide resolved
apps/app/src/app/(app)/[orgId]/people/dashboard/components/EmployeesOverview.tsx
Show resolved
Hide resolved
| dto.hardware_model = device.hardwareModel ?? ''; | ||
| dto.seen_time = device.lastCheckIn?.toISOString() ?? ''; | ||
| dto.created_at = device.installedAt.toISOString(); | ||
| dto.updated_at = device.installedAt.toISOString(); |
There was a problem hiding this comment.
API returns incorrect updated_at timestamp for device-agent devices
Medium Severity
The mapAgentDeviceToDto function sets dto.updated_at to device.installedAt.toISOString(), which is the same value as created_at. This is incorrect since lastCheckIn is available (used on line 292 for seen_time) and would be the semantically correct value for updated_at. API consumers expecting updated_at to reflect when the device record was last updated will receive stale data that never changes after initial creation.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| details: { message: host.disk_encryption_enabled ? 'Enabled' : 'Not enabled' }, | ||
| checkedAt: host.seen_time || new Date().toISOString(), | ||
| }, | ||
| ], |
There was a problem hiding this comment.
Fleet device compliance only checks disk encryption
Medium Severity
In getFleetDevices, isCompliant for fleet devices is now determined solely by host.disk_encryption_enabled. Previously, compliance was based on all fleet policies passing (including MDM enrollment on macOS). This regression means fleet devices may show as "Compliant" in the compliance chart despite failing other policy checks, misleading users about their security posture.
| macos: 'macOS', | ||
| windows: 'Windows', | ||
| linux: 'Linux', | ||
| }; |
There was a problem hiding this comment.
Duplicated CHECK_NAMES and PLATFORM_LABELS constants across files
Low Severity
The CHECK_NAMES and PLATFORM_LABELS constants are identically defined in DeviceDetails.tsx, EmployeeTasks.tsx, and EmployeeDevicesList.tsx. Adding a new check type or platform label requires updating all three files, and inconsistencies are likely (as already seen in the dead EmployeeDevicesColumns.tsx which is missing linux). These belong in a shared constants module.
Additional Locations (2)
| ) : ( | ||
| <button | ||
| onClick={loadMore} | ||
| className="text-primary hover:text-primary/80 text-sm font-medium" |
There was a problem hiding this comment.
Refactored EmployeeCompletionChart is now unused dead code
Low Severity
EmployeeCompletionChart was substantially rewritten (269 lines) but its only consumer, EmployeesOverview, was deleted in this same PR. A codebase-wide search confirms no remaining imports of EmployeeCompletionChart. This leaves a large, newly refactored component as dead code.
| completed: policiesCompleted + trainingsCompleted, | ||
| total: totalTasks, | ||
| }; | ||
| } |
There was a problem hiding this comment.
Training completion count may exceed total for task badge
Low Severity
The trainingsCompleted count in TeamMembers.tsx counts all DB completion records with completedAt !== null, without filtering to only videos that still exist in trainingVideosData. Meanwhile totalTrainingVideos is derived from trainingVideosData.length. If a training video is retired from the static list but a completion record remains, completed can exceed total, producing a display like "6/5" in the TASKS badge.


This is an automated pull request to merge lewis/comp-device-agent-overhaul into dev.
It was created by the [Auto Pull Request] action.