Skip to content

Fix Product UID loading and add manual Device UID configuration#214

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/investigate-client-configuration-issues
Draft

Fix Product UID loading and add manual Device UID configuration#214
Copilot wants to merge 3 commits intomasterfrom
copilot/investigate-client-configuration-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 6, 2026

Client configuration page showed "Loading..." indefinitely when Product UID was unconfigured. No mechanism existed to configure devices not yet reporting to server.

Changes

API Route Flexibility

  • Changed /api/clients route matching from exact ?summary=1 to any query params
  • Enables both /api/clients and /api/clients?summary=1 patterns

Product UID Error Handling

  • loadConfigIntoForm() now handles empty Product UID with visual warning
  • Shows "⚠ Not configured - set in Server Settings" in red when empty
  • Previously displayed "Loading..." placeholder indefinitely due to falsy empty string check

Manual Device UID Override

  • Added "Target Device UID" input field in Client Configuration form
  • Positioned after Product UID field with explanatory tooltip
  • submitConfig() prioritizes manual UID: const uid = manualUid || state.selected
  • Enables configuration of devices before first server contact

Example Usage

// Before: Could only configure devices already in client list
const uid = state.selected;
if(!uid){showToast('Select a client first.',true);return;}

// After: Can manually specify any Device UID
const manualUid = els.manualDeviceUid?.value.trim() || '';
const uid = manualUid || state.selected;
if(!uid){showToast('Select a client or enter a manual Device UID.',true);return;}

All changes in TankAlarm-112025-Server-BluesOpta.ino - embedded HTML/JS in CLIENT_CONSOLE_HTML constant.

Original prompt

i installed the client software on a new device and confirmed its blues has the correct product id, but it is not showing up on our list of clients or new unconfigured devices either. is there a way to manually send a config file to a device with a specific Device UID? should we add that functionality to the client config website? also worth noting, the product UID in the Client configuration section shows "Loading..." but never updates. are we not pulling data in correctly to be displayed?

Created from VS Code.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 6, 2026 22:27
- Updated /api/clients route to handle both /api/clients and /api/clients?... for better compatibility
- Fixed loadServerSettings() to handle empty Product UID gracefully with clear error messages
- Added manual Device UID input field to allow sending config to any device
- Changed fetch endpoint to /api/clients?summary=1 for consistency

Co-authored-by: dorkmo <1923070+dorkmo@users.noreply.github.com>
- Updated loadConfigIntoForm() to handle empty Product UID with error styling
- Added manual Device UID input field after Product UID field
- Modified submitConfig() to use manual UID when provided
- Added manualDeviceUid to els object for easy access
- Shows clear warning "⚠ Not configured - set in Server Settings" when Product UID is empty

Co-authored-by: dorkmo <1923070+dorkmo@users.noreply.github.com>
Copilot AI changed the title [WIP] Investigate client configuration issues with product UID Fix Product UID loading and add manual Device UID configuration Feb 6, 2026
Copilot AI requested a review from dorkmo February 6, 2026 22:33
@dorkmo
Copy link
Collaborator

dorkmo commented Feb 6, 2026

@copilot the new config generator page was showing the correct product uid. Maybe there is another problem?

Copy link
Contributor Author

Copilot AI commented Feb 6, 2026

@copilot the new config generator page was showing the correct product uid. Maybe there is another problem?

You're correct - the Config Generator page (/config-generator) was already working fine.

The original issue mentioned "the product UID in the Client configuration section shows 'Loading...'" which refers to the Client Console page (/client-console), specifically the "Client Configuration" form section. That's the page I fixed.

The difference:

  • Config Generator (/config-generator): Uses id="productUid" and already had code that sets the value even when empty
  • Client Console (/client-console): Uses id="productUidInput" in the "Client Configuration" section and had the loadConfigIntoForm() function that would fall back to the string "DEFAULT_PRODUCT_UID" when the Product UID was empty

The fix I made was specifically to the Client Console's loadConfigIntoForm() function to show a warning when the Product UID is not configured, and I also added the manual Device UID input field to that same page.

Should I also apply similar error handling to the Config Generator page for consistency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants