Bug #15227

[API][Workbench] Adding tags via workbench1's tag editor saves the JSON string to properties

Added by Lucas Di Pentima 2 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
-
Target version:
Start date:
05/17/2019
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Story points:
-
Release relationship:
Auto

Description

When viewing a collection with previosly saved tags, they're rendered ok on the editor, but when saving changes/new tags, the API server is saving them as a json string, for example:

...
properties: "{\"tagName\":\"tagValue\"}" 
...

This happens with the rails 5.0 api server and both rails 4.2 & 5.0 workbench1. OTOH, editing the collection with arv edit and manually setting the properties field works ok.


Subtasks

Task #15234: Review 15227-apiserver-properties-bugfixResolvedLucas Di Pentima

Associated revisions

Revision 3a355673
Added by Lucas Di Pentima about 2 months ago

Merge branch '15227-apiserver-properties-bugfix'
Closes #15227

Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <>

History

#1 Updated by Tom Clegg 2 months ago

If the database has a json-encoded string (instead of a json-encoded hash) then it seems we have at least two bugs:
  1. apiserver is allowing non-objects into the properties field(s) -- if it's allowing clients to store strings, it might be allowing false, [], and null too
  2. apiserver is not decoding json-encoded parameters supplied by workbench (I'm guessing the problem is apiserver failing to decode, rather than workbench double-encoding, just because ISTR request parsing changed in the rails5 upgrade)

#2 Updated by Lucas Di Pentima 2 months ago

  • Target version set to 2019-05-22 Sprint
  • Assigned To set to Lucas Di Pentima
  • Status changed from New to In Progress

#3 Updated by Lucas Di Pentima about 2 months ago

Updates at f337797b4 - branch 15227-apiserver-properties-bugfix
Test run: https://ci.curoverse.com/job/developer-run-tests/1240/

Fixes type checking on JSON attributes.

#4 Updated by Tom Clegg about 2 months ago

This LGTM, thanks.

#5 Updated by Lucas Di Pentima about 2 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Resolved

#6 Updated by Tom Morris about 2 months ago

  • Release set to 15

Also available in: Atom PDF