jester icon indicating copy to clipboard operation
jester copied to clipboard

formData identical keys

Open noirscape opened this issue 1 year ago • 0 comments

Firstly, please correct me if I'm making any mistakes, but I don't think I am.

It is possible to have multiple entries with the same formData name - this is how, for example, clients send over file uploads that accept multiple files (in my example, I've written a PWA that tries to handle multiple files as a share target serverside). Unfortunately, it is deprecated to have a Table with duplicate keys (the add procedure is even being deprecated in favor of just doing []= assignments) and the allValues() procedure doesn't work with the OrderedTable that jester uses.

This means it's currently impossible to actually retrieve multiple entries from a table unless you manually iterate over pairs or values and manually check the key on the former/read out the fields table on the latter.

One possible solution could be to redefine the MultiData object to be an OrderedTable[string, seq[tuple[fields: StringTableRef, body: string]]] instead and append to the sequence instead, but this would probably hard break existing applications.

noirscape avatar Apr 28 '23 21:04 noirscape