Add legacy device deprecation banner for users and admins#420
Add legacy device deprecation banner for users and admins#420
Conversation
WalkthroughThis PR adds support for detecting and displaying legacy device warnings across the application. On the backend, a new endpoint Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
frontend/src/components/VaultList.vue (1)
219-220: Optional chaining on non-optional field.The
devicesfield onUserDtois typed asDeviceDto[](non-optional). The optional chainingmeWithLegacy.devices?.lengthis defensive but technically unnecessary. This is a minor nitpick and safe to keep as-is.📝 Optional simplification
- hasLegacyDevices.value = (meWithLegacy.devices?.length ?? 0) > 0; + hasLegacyDevices.value = meWithLegacy.devices.length > 0;🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@frontend/src/components/VaultList.vue` around lines 219 - 220, The optional chaining on a non-optional field is unnecessary; in the block that awaits userdata.meWithLegacyDevicesAndLastAccess, replace the defensive access meWithLegacy.devices?.length with a direct access meWithLegacy.devices.length (keeping the surrounding assignment to hasLegacyDevices.value) so the code uses the declared DeviceDto[] type correctly; update the expression where meWithLegacy and hasLegacyDevices are referenced to remove the "?".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@frontend/src/components/VaultList.vue`:
- Around line 219-220: The optional chaining on a non-optional field is
unnecessary; in the block that awaits userdata.meWithLegacyDevicesAndLastAccess,
replace the defensive access meWithLegacy.devices?.length with a direct access
meWithLegacy.devices.length (keeping the surrounding assignment to
hasLegacyDevices.value) so the code uses the declared DeviceDto[] type
correctly; update the expression where meWithLegacy and hasLegacyDevices are
referenced to remove the "?".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 10fdecee-193f-4700-8683-2e922ec07cc0
📒 Files selected for processing (7)
backend/src/main/java/org/cryptomator/hub/api/DeviceResource.javabackend/src/main/java/org/cryptomator/hub/entities/LegacyDevice.javafrontend/src/common/backend.tsfrontend/src/components/AdminSettings.vuefrontend/src/components/LegacyDeviceList.vuefrontend/src/components/VaultList.vuefrontend/src/i18n/en-US.json
overheadhunter
left a comment
There was a problem hiding this comment.
I have slight concerns regarding fetch efficiency of userdata.meWithLegacyDevicesAndLastAccess but since this is just a temporary banner, this should work.
@SailReal do you agree?
To inform users ahead of time, a warning banner is shown on the profile page and vault list whenever the logged-in user still has legacy devices.
Admins additionally see a variant of this banner on the vault list and admin settings page when any user in the system has legacy devices.
Screenshots:

User – Profile Page
User – Vault List

Admin – Vault List

Admin – Admin Settings
