Skip to content

Problem with Complex. #1234

Open
Open
@prosvitco-artur

Description

@prosvitco-artur

I have found an issue.
When adding new Groups, their IDs are generated using this function.

const ALPHABET = "Uint8ArdomValuesObj012345679BCDEFGHIJKLMNPQRSTWXYZ_cfghkpqvwxyz";
export default function uniqueId() {
	return "cf-${generate(ALPHABET, 21)}";
}

As we can see, the string uses the character '_'.
There is a small probability that this character will appear twice (but the probability exists, and it has happened to me three times in one day, you could say I won the lottery).

What’s the problem, you ask? The problem is that in this function:

handleGroupFieldChange = (fieldId, fieldValue) => {
	const {
		id,
		value,
		onChange
	} = this.props;

	onChange(id, produce(value, (draft) => {
		const path = fieldId.split('__');
		const fieldName = path.pop();
		const group = find(draft, ['_id', path.pop()]);

		set(group, fieldName, fieldValue);
	}));
}

the string is split using '__', and in my case, these fields are not being saved. Therefore, please remove the '_' from the ID generation string in one of the upcoming updates!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions