-
Notifications
You must be signed in to change notification settings - Fork 238
[FEAT] Upload images for failed device policy #2018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
… images are uploaded
…uploaded by employee
PR SummaryIntroduces end-to-end support for attaching and viewing images as evidence for device policy results.
Written by Cursor Bugbot for commit 0a46363. This will update automatically on new commits. Configure here. |
…tatus on org dashboard
…load-policy-images
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
|
|
||
| {hasImages && ( | ||
| <> | ||
| <PolicyImagePreview image={images[currentIndex]} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing array bounds check in image preview modal
Low Severity
The PolicyImagePreviewModal in apps/app lacks a bounds check before accessing images[currentIndex]. The portal version has hasImages && currentIndex >= 0 && currentIndex < images.length, but this version only checks hasImages. If images.length changes between renders (before the useEffect resets currentIndex to 0), accessing images[currentIndex] with an out-of-bounds index could pass undefined to PolicyImagePreview, causing a brief "Failed to load image" flash.
| @@ -0,0 +1,49 @@ | |||
| 'use server'; | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Incorrect directive in Next.js Route Handler
Medium Severity
The 'use server' directive is incorrectly placed in a Next.js Route Handler file. This directive is intended for Server Actions, not Route Handlers. Route Handlers (files exporting HTTP method functions like GET, POST) are inherently server-side and don't use this directive. Other route files in the codebase (confirm-fleet-policy/route.ts, fleet-policy/route.ts) correctly omit this directive. This misuse could cause unexpected behavior in certain Next.js configurations or future versions.
This is an automated pull request to merge chas/upload-policy-images into dev.
It was created by the [Auto Pull Request] action.