Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Form is not fully robust to updating documentation and default tag in rare cases #1098

@kkoreilly

Description

@kkoreilly

Describe the bug

As discussed in #1096, there are ways to break the Form updating logic for default struct tags and field documentation.

How to reproduce

If you set the struct of a Form to a struct that is otherwise the same but has different default struct tags or different documentation, it will not update accordingly, since the default tags and documentation are only computed in an init function, which will not be called again if the name, type, and index of the field do not change. That is an exceedingly rare possibility and not worth fixing now, but we should fix it eventually; all of the doc, readOnlyTag, def, hasDef variables etc need to be recomputed every time in every relevant nested closures instead of just being computed once in an init function.

Example code

No response

Relevant output

No response

Platform

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working correctlyconfirmedThis bug has been confirmedlow priorityLower priority; do eventually but not urgent

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions