Skip to content

Strict mode with etna gem causes exception on update #206

@coleshaw

Description

@coleshaw

May be related to #202, but it seems like updating certain types of attributes with null leads to an issue with temporary IDs.

When updating a bunch of clinical data via the etna gem, using strict mode leads to a Magma error:

ERROR:2021-03-10T20:48:11+00:00 9hdp4p Caught unspecified error
ERROR:2021-03-10T20:48:11+00:00 9hdp4p undefined method `real_id' for nil:NilClass
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader/temp_id.rb:14:in `real_id'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader/record_entry.rb:107:in `block in temp_entry'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader/record_entry.rb:104:in `each'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader/record_entry.rb:104:in `map'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader/record_entry.rb:104:in `temp_entry'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader.rb:427:in `map'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader.rb:427:in `block in update_temp_ids'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader.rb:423:in `each'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader.rb:423:in `update_temp_ids'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/loader.rb:257:in `dispatch_record_set'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/server/update.rb:29:in `load_revisions'
ERROR:2021-03-10T20:48:11+00:00 9hdp4p /app/lib/magma/server/update.rb:8:in `action'

It's not clear under what conditions this happens yet, except we know that disabling strict mode works. So I suspect that one of the null values introduced by strict mode leads to the situation where Magma thinks there is a temporary ID somewhere? Or perhaps trying to set "empty" on a parent model causes the above? Need to investigate.

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