Harden disabled virtual display self-test #3

Merged
NotAlexNoyle merged 1 commits from agent/harden-disabled-virtual-display-check into main 2026-07-23 18:27:28 -04:00
NotAlexNoyle commented 2026-07-23 16:54:07 -04:00 (Migrated from github.com)

What changed

  • Re-check shop.display-items directly before the AFTER_ON_ENABLE virtual display manager self-test.
  • Capture VirtualDisplayItemManager once and reuse the same reference for the null check and packet test.

Why

PR #2 only checked the cached isDisplayEnabled() state. Servers configured with shop.display-items: false could still reach the manager assertion and log:

VirtualDisplayItemManager is null, this shouldn't happen...

The manager is intentionally absent when display items are disabled, so the self-test must honor the source configuration as well as the cached flag.

Impact

Disabled display configurations no longer emit the false-positive warning. Enabled virtual display configurations retain the existing null warning and packet self-test.

Validation

  • Compared agent/harden-disabled-virtual-display-check against main.
  • Branch is one commit ahead and not behind.
  • Exactly one file changed: 5 additions, 4 deletions.
  • A local Maven build was not available because the GitHub CLI is not installed and outbound Git cloning is unavailable in this environment.

This change is based solely on the existing GPL-era QuickShop-OG source. No post-license-change AGPL code was referenced or used.

## What changed - Re-check `shop.display-items` directly before the `AFTER_ON_ENABLE` virtual display manager self-test. - Capture `VirtualDisplayItemManager` once and reuse the same reference for the null check and packet test. ## Why PR #2 only checked the cached `isDisplayEnabled()` state. Servers configured with `shop.display-items: false` could still reach the manager assertion and log: `VirtualDisplayItemManager is null, this shouldn't happen...` The manager is intentionally absent when display items are disabled, so the self-test must honor the source configuration as well as the cached flag. ## Impact Disabled display configurations no longer emit the false-positive warning. Enabled virtual display configurations retain the existing null warning and packet self-test. ## Validation - Compared `agent/harden-disabled-virtual-display-check` against `main`. - Branch is one commit ahead and not behind. - Exactly one file changed: 5 additions, 4 deletions. - A local Maven build was not available because the GitHub CLI is not installed and outbound Git cloning is unavailable in this environment. This change is based solely on the existing GPL-era QuickShop-OG source. No post-license-change AGPL code was referenced or used.
Sign in to join this conversation.