Skip to content

Payment settings: Update button disabled after changing Plan/Agent ID, API key disappears #78

Closed as not planned

Description

@vybe

Bugs

Two related issues in the Nevermined payment settings panel (NeverminedPanel.vue):

1. Changing Plan ID or Agent ID does not enable the Update button

The isFormValid computed property (line 264) requires all fields to be non-empty, including nvm_api_key:

const isFormValid = computed(() => {
  return form.value.nvm_api_key &&
    form.value.nvm_environment &&
    form.value.nvm_agent_id &&
    form.value.nvm_plan_id &&
    form.value.credits_per_request >= 1
})

But the API key is never loaded back from the server (it's encrypted server-side), so nvm_api_key is always empty after load. This means any field change still leaves the button disabled until the user re-enters the API key.

2. API key disappears and must be re-entered on every update

After a successful save, the API key is explicitly cleared (line 301):

form.value.nvm_api_key = '' // Clear after save

Combined with the fact that loadConfig() never populates the API key field (lines 278-282), users must re-enter their API key every time they want to update any setting — even unrelated ones like Plan ID or credits.

Expected Behavior

  • Changing Plan ID, Agent ID, environment, or credits should enable the Update button without requiring the API key to be re-entered
  • The API key field should show a masked placeholder (e.g., ••••••••) when a key is already configured, indicating one is set
  • Only require the API key field when initially configuring or explicitly changing the key

Suggested Fix

  1. Make nvm_api_key optional in isFormValid when a config already exists (config.value is non-null)
  2. On the backend, treat an empty/missing nvm_api_key in the update payload as "keep existing key"
  3. Show a placeholder in the API key field when a key is already stored (e.g., sk-****...****)
  4. Track dirty state — only enable Update when at least one field actually changed from its saved value

Files

  • src/frontend/src/components/NeverminedPanel.vue — form validation and API key handling
  • src/backend/routers/nevermined.py — backend config update endpoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcomplexity-lowtheme-monetization

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions