Bug #21764
closedCrash when trying to copy file from collection
Description
Steps to reproduce in jutro
(doesn't happen in tordo
and pirca
):
- Get into a collection with at least 1 file
- Right-click on the file and select "Copy item into existing collection" to display the dialog
- Expand the "Shared with me" subtree to make the app crash. (if copying a file from a "shared with me" collection, this subtree will get automatically expanded, and the app will also crash)
This error is displayed when using a dev version of workbench:
× Error: Objects are not valid as a React child (found: object with keys {createdAt, currentVersionUuid, deleteAt, description, etag, fileCount, fileSizeTotal, href, isTrashed, kind, modifiedAt, modifiedByClientUuid, modifiedByUserUuid, name, ownerUuid, portableDataHash, preserveVersion, properties, replicationConfirmed, replicationConfirmedAt, replicationDesired, storageClassesConfirmed, storageClassesConfirmedAt, storageClassesDesired, trashAt, uuid, version}). If you meant to render a collection of children, use an array instead. in span (at tree.tsx:280) in span (at tree.tsx:278) in div (at tree.tsx:277) in div (at tree.tsx:255) in div (at tree.tsx:229) in FlatTree (at tree.tsx:387) in div (at tree.tsx:350) in ul (created by List) in List (created by WithStyles(List)) in WithStyles(List) (at tree.tsx:345) in Unknown (created by WithStyles(Component)) in WithStyles(Component) (created by Connect(WithStyles(Component))) in Connect(WithStyles(Component)) (created by Connect(Connect(WithStyles(Component)))) in Connect(Connect(WithStyles(Component))) (created by Connect(Connect(Connect(WithStyles(Component))))) in Connect(Connect(Connect(WithStyles(Component)))) (at projects-tree-picker.tsx:174) in div (at projects-tree-picker.tsx:173) in div (at projects-tree-picker.tsx:163) in div (at projects-tree-picker.tsx:156) in FileInputComponent (created by WithStyles(FileInputComponent)) in WithStyles(FileInputComponent) (created by Connect(WithStyles(FileInputComponent))) in Connect(WithStyles(FileInputComponent)) (at tree-picker-field.tsx:73) in div (at tree-picker-field.tsx:72) in div (at tree-picker-field.tsx:71) in DirectoryTreePickerFieldComponent (created by Connect(DirectoryTreePickerFieldComponent)) in Connect(DirectoryTreePickerFieldComponent) (created by ConnectedField) in ConnectedField (created by Connect(ConnectedField)) in Connect(ConnectedField) (created by Field) in Field (at collection-form-fields.tsx:65) in DirectoryPickerField (at dialog-collection-partial-copy-to-existing-collection.tsx:29) in Unknown (at form-dialog.tsx:71) in div (created by DialogContent) in DialogContent (created by WithStyles(DialogContent)) in WithStyles(DialogContent) (at form-dialog.tsx:70) in form (at form-dialog.tsx:66) in div (created by Paper) in Paper (created by WithStyles(Paper)) in WithStyles(Paper) (created by Dialog) in div (created by Dialog) in Transition (created by Fade) in Fade (created by WithTheme(Fade)) in WithTheme(Fade) (created by Dialog) in RootRef (created by Modal) in div (created by Modal) in Portal (created by Modal) in Modal (created by WithStyles(Modal)) in WithStyles(Modal) (created by Dialog) in Dialog (created by WithStyles(Dialog)) in WithStyles(Dialog) (at form-dialog.tsx:59) in Unknown (created by WithStyles(Component)) in WithStyles(Component) (at dialog-collection-partial-copy-to-existing-collection.tsx:17) in DialogCollectionPartialCopyToExistingCollection (at picker-id.tsx:16) in Unknown (created by Form(Component)) in Form(Component) (created by Connect(Form(Component))) in Connect(Form(Component)) (created by ReduxForm) in ReduxForm (created by Connect(ReduxForm)) in Connect(ReduxForm) (at workbench.tsx:425) in div (created by Grid) in Grid (created by WithStyles(Grid)) in WithStyles(Grid) (at workbench.tsx:331) in Unknown (created by WithStyles(Component)) in WithStyles(Component) (at main-panel-root.tsx:67) in div (created by Grid) in Grid (created by WithStyles(Grid)) in WithStyles(Grid) (at main-panel-root.tsx:64) in Unknown (created by WithStyles(Component)) in WithStyles(Component) (created by Connect(WithStyles(Component))) in Connect(WithStyles(Component)) (at src/index.tsx:199) in MainPanelComponent (created by Route) in Route (at src/index.tsx:219) in Switch (at src/index.tsx:206) in Router (created by ConnectedRouter) in ConnectedRouter (at src/index.tsx:205) in Provider (at src/index.tsx:204) in Unknown (at src/index.tsx:203) in MuiThemeProviderOld (at src/index.tsx:202) in App (at src/index.tsx:230) ▶ 75 stack frames were collapsed. default src/store/data-explorer/data-explorer-middleware.ts:110 107 | } 108 | }); 109 | }), > 110 | default: () => next(action), | ^ 111 | }); 112 | }; 113 | }; View compiled evalMatch src/index.ts:125 match src/index.ts:129 (anonymous function) src/store/data-explorer/data-explorer-middleware.ts:32 29 | handler(data); 30 | } 31 | }; > 32 | dataExplorerActions.match(action, { | ^ 33 | SET_PAGE: handleAction(() => { 34 | api.dispatch(actions.REQUEST_ITEMS(false)); 35 | }), View compiled (anonymous function) src/store/tree-picker/tree-picker-middleware.ts:50 47 | } 48 | 49 | // pass it on to the reducer > 50 | const r = next(action); | ^ 51 | 52 | treePickerSearchActions.match(action, { 53 | SET_TREE_PICKER_PROJECT_SEARCH: ({ pickerId }) => View compiled default src/store/data-explorer/data-explorer-middleware.ts:110 107 | } 108 | }); 109 | }), > 110 | default: () => next(action), | ^ 111 | }); 112 | }; 113 | }; View compiled evalMatch src/index.ts:125 match src/index.ts:129 (anonymous function) src/store/data-explorer/data-explorer-middleware.ts:32 29 | handler(data); 30 | } 31 | }; > 32 | dataExplorerActions.match(action, { | ^ 33 | SET_PAGE: handleAction(() => { 34 | api.dispatch(actions.REQUEST_ITEMS(false)); 35 | }), View compiled default src/store/data-explorer/data-explorer-middleware.ts:110 107 | } 108 | }); 109 | }), > 110 | default: () => next(action), | ^ 111 | }); 112 | }; 113 | }; View compiled This screen is visible only in development. It will not appear if the app crashes in production. Open your browser’s developer console to further inspect this error. Click the 'X' or hit ESC to dismiss this message.
Updated by Peter Amstutz 7 months ago
- Target version changed from Future to Development 2024-06-05 sprint
Updated by Lucas Di Pentima 7 months ago
Maybe a useful clue: when using the "Copy item into a new collection", and expanding the "Shared with me" subtree on the dialog, the app doesn't crash, so the issue might me on the difference in behavior of both actions.
Updated by Peter Amstutz 6 months ago
- Target version changed from Development 2024-06-05 sprint to Development 2024-06-19 sprint
Updated by Peter Amstutz 5 months ago
- Target version changed from Development 2024-06-19 sprint to Development 2024-07-03 sprint
Updated by Stephen Smith 5 months ago
Changes at arvados|939e45cab9e979949b6cd22a08581ae102fd112a branch 21764-project-picker-crash
Tests developer-run-tests-services-workbench2: #955
- All agreed upon points are implemented / addressed.
- Added cypress to docker container by running yarn install (useful since cypress is installed to the user home dir so mounting cypress into the docker container makes node_modules available but not cypress)
- Check if node value is string before loading it into data, prevents crash
- Added other type safety to tree picker area
- Consolidated tree picker node extraction and reused code for tests
- Anything not implemented (discovered or discussed during work) has a follow-up story.
- none
- Code is tested and passing, both automated and manual, what manual testing was done is described
- Added test to ensure items with empty string don't crash the picker
- Manually checked to see bug is fixed
- Documentation has been updated.
- n/a
- Behaves appropriately at the intended scale (describe intended scale).
- no change in scale
- Considered backwards and forwards compatibility issues between client and server.
- n/a
- Follows our coding standards and GUI style guidelines.
- no change
Updated by Lucas Di Pentima 5 months ago
Manually tested it and it now works correctly, thanks!
It's a shame that you had to write a unit test that will soon be discarded. Do you think this would be a good opportunity to re-write it as a cypress component test (now that you have everything fresh on your mind about it). Not an issue if you would prefer to just merge, though.
Other than that, it LGTM.
Updated by Stephen Smith 5 months ago
- Status changed from In Progress to Resolved
Merged in arvados|114b890d58dbe8f7a4c41aeb14f7042c9145199e
(Cypress component tests can't be run without project config which would make a conflict if I did it here as Lisa is currently working on that)