Skip to content

User settings in EX_APP do not work correctly #393

@ser

Description

@ser

Describe the bug

I have problems with setting the user config.

I set up the user settings:

# Register personal (user) settings
PERSONAL_SETTINGS = SettingsForm(
    id="context_agent_personal_form",
    section_type="personal",
    section_id="ai_integration_team",
    title=_("Context Agent Preferences"),
    description=_("Personal preferences for Context Agent."),
    fields=[
        SettingsField(
            id="context_agent___mcp_config",
            title=_("MCP Config"),
            description=_(
                'JSON configuration for the MCP. Structured as {"service_name": {"url": "https://service.url","transport": "streamable_http"}}. For more details view the documentation for context_agent.'
            ),
            type=SettingsFieldType.TEXT,
            default="",
            placeholder='{"weather": {"url": "https://weather.internet/mcp","transport": "streamable_http"}}',
        ),
    ],
)

I add them to the enabled_handler():

nc.ui.settings.register_form(PERSONAL_SETTINGS)

And the user can see the config indeed, but when tries to modify the value, the browser console shows 403...

When I set the value in the table oc_preferences_ex they are correctly visible in that setting. Only "writing" from browser does not work correctly.

Unfortunately there is no single other ex_app which sets user settings, so I am unable to confirm that my code is correct, but I suspect it's a bug in nextcloud routing.

Steps/Code to Reproduce

Expected Results

Actual Results

Setup configuration

I initially reported it in an other app ( nextcloud/context_agent#105 ) , but I think it's the bug in nc_py_api.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions