Creating a record can put Stripes in a weird state

Description

In trying to provoke the mod-users state described by , I have successfully got something to go wrong by creating a new user with username "a" (and no other fields), then clicking the "Users" tab of the Stripes bar rather than dismissing the add-record popup with its close button. In _this+ weird state, it's Stripes rather then mod-users that's gone wrong, as the network responses all look good.

CSP Request Details

None

CSP Rejection Details

None

Potential Workaround

None

Checklist

hide

TestRail: Results

Activity

Show:

Mike TaylorJanuary 19, 2017 at 2:16 PM

I'm not sure why I didn't close this already: the issue it describes is now understood, and deals with it. The remaining part (wondering whether records should be created with empty subrecords) is its own issue in . So there is nothing left to be done on this one.

Mike TaylorJanuary 17, 2017 at 2:40 PM

Let's discuss this (if more need be said) over on . I think what you're saying makes sense.

Niels Erik NielsenJanuary 17, 2017 at 2:14 PM

That's not how redux-form operates, afaik. It assembles a record to POST from what is filled.

I know that some modules will refuse records with embedded empty records, but I've seen that only with repeatable sub-records - embedded arrays in other words - I thus found I had to amend such records with ui-okapi-console/utils/removeEmptyObjectsFromArray.js.

In this case, however, the embedded structure 'personal' does not repeat / is not an array, so mod-users might accept a record with an empty 'personal', I don't know.

I think I'd be for simply making the UI more tolerant of the back-end responding with records where non-mandatory elements are missing.

Mike TaylorJanuary 17, 2017 at 1:02 PM

Haha, OK, knowing the cause, the pattern now makes sense.

Searching for "a" will break the display if username is the presently selected sort criterion, since then it will sort to the top. But if one of the other criteria is selected, then its undefined values make it sort to the bottom, and it never gets displayed – so the first ten records do display all right.

Similarly, sorting by username breaks the display if the currently selected set of records includes the bad one – because the username sort brings it to the top.

The problem here is (I think) that record creation should make all parts of the record, even if the fields are empty. At least, that's what I am going to file, and Niels-Erik can argue if he wishes

Mike TaylorJanuary 17, 2017 at 12:53 PM

So that resolves the problem of why the weird state persists across browser reloads – good!

But it doesn't really explain why the manifestation of the bug is so erratic. Why does a search for "a" sometimes result in a list with the bad record that breaks the display? And why does it sometimes (apparently) omit that record, so that the ones it does return can be successfully displayed?

Done

Details

Assignee

Reporter

Labels

Priority

TestRail: Cases

Open TestRail: Cases

TestRail: Runs

Open TestRail: Runs

Created January 17, 2017 at 12:37 PM
Updated January 19, 2017 at 2:17 PM
Resolved January 19, 2017 at 2:17 PM
TestRail: Cases
TestRail: Runs