Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data forms with a field named "username" are not displayed #2939

Closed
truenicoco opened this issue May 31, 2022 · 2 comments
Closed

Data forms with a field named "username" are not displayed #2939

truenicoco opened this issue May 31, 2022 · 2 comments
Labels

Comments

@truenicoco
Copy link

Describe the bug
When a form, sent via an adhoc command, contains a field named "username", it is not displayed at all.

Expected behavior
username is a valid field name, so the form should be displayed

Environment:

  • Desktop
  • Firefox
  • Converse.js version [e.g. 4.2.0]

Additional context
I commented a minimal example here: #2937 (comment) before identifying the issue.

Here is another attemps, with debug logs:

2022-05-31T09:21:30.622Z DEBUG:<iq type="set" to="dummy.localhost" id="5bb71f86-f5d3-4760-93a4-f56461c86bc6:sendIQ">
    <command node="registration" action="execute" />
</iq>log.js:70:19
 2022-05-31T09:21:30.627Z DEBUG:<iq to="test@localhost/converse.js-10125775" xmlns="jabber:client" type="result" xml:lang="en" id="5bb71f86-f5d3-4760-93a4-f56461c86bc6:sendIQ" from="dummy.localhost">
    <command status="executing" node="registration" sessionid="1653988890.6236324-886f3dc54ce443c6b4a1805877bf7faa" xmlns="http://jabber.org/protocol/commands">
        <actions>
            <complete />
        </actions>
        <x type="form" xmlns="jabber:x:data">
            <title>Title</title>
            <instructions>Instructions</instructions>
            <field type="boolean" label="Remove my registration" var="remove">
                <value>0</value>
                <required />
            </field>
            <field type="text-single" label="User name" var="username">
                <value>n</value>
                <required />
            </field>
            <field type="text-single" label="Password" var="password">
                <value>n</value>
                <required />
            </field>
            <field type="text-single" label="Some optional stuff not covered by jabber:iq:register" var="something_else">
                <value />
            </field>
        </x>
    </command>
</iq>log.js:70:19
ERROR: Error while trying to execute command for dummy.localhost log.js:64:19
    log log.js:64
    error log.js:81
    toggleCommandForm utils.js:159
    toggleCommandForm adhoc-commands.js:80
    toggleCommandForm adhoc-commands.js:40
    handleEvent lit-html.ts:2047
    (Asynchrone : EventListener.handleEvent)
    _$AI lit-html.ts:2036
    m lit-html.ts:1240
    T lit-html.ts:1582
    _$AI lit-html.ts:1434
    S lit-html.ts:1647
    _$AI lit-html.ts:1438
    m lit-html.ts:1240
    T lit-html.ts:1582
    _$AI lit-html.ts:1434
    m lit-html.ts:1240
    T lit-html.ts:1569
    _$AI lit-html.ts:1434
    tu lit-html.ts:677
    update lit-element.js:6
    performUpdate reactive-element.js:6
    scheduleUpdate reactive-element.js:6
    _$E_ reactive-element.js:6
    requestUpdate reactive-element.js:6
    set reactive-element.js:6
    fetchCommands adhoc-commands.js:61
    fetchCommands adhoc-commands.js:36
    handleEvent lit-html.ts:2047
    (Asynchrone : EventListener.handleEvent)
    _$AI lit-html.ts:2036
    m lit-html.ts:1240
    T lit-html.ts:1582
    _$AI lit-html.ts:1434
    tu lit-html.ts:677
    update lit-element.js:6
    performUpdate reactive-element.js:6
    scheduleUpdate reactive-element.js:6
    _$E_ reactive-element.js:6
    requestUpdate reactive-element.js:6
    o reactive-element.js:6
    Nd reactive-element.js:6
    _u lit-element.js:6
    hv element.js:5<anonyme>
    adhoc-commands.js:25
    p lit-html.ts:1181
    T lit-html.ts:1572
    _$AI lit-html.ts:1434
    tu lit-html.ts:677
    render view.js:79
    initialize base.js:28
    initialize user-settings.js:11
    Iv view.js:45
    s helpers.js:32
    s helpers.js:32
    create api.js:46
    show api.js:26
 ERROR: 517/nl.xForm2TemplateResult@https://cdn.conversejs.org/dist/converse.min.js:240:391
517/toggleCommandForm/e.fields
@LukasBrilla5
Copy link

Hello can I work on this issue ?

@jcbrand
Copy link
Member

jcbrand commented Oct 19, 2022

@LukasBrilla5: In general, you don't have to ask permission to work on any issue. You can just start working. If you have any specific questions on where to start, you can ask them in the issue. Try to be as specific as you can with a question.

I looked at this issue to see if I can give you some hints on how to fix it, but realized that there was some general refactoring work needed for the ad-hoc commands feature, so I decided to do that and fix the bug in the process.

If you would still like to contribute, let me know and we can see whether we can find a fitting issue for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants