samvera / active_fedora

A Rails interface to the Fedora repository, akin to ActiveModel
Other
54 stars 63 forks source link

Allow initializing OrderedList with an existing NodeCache #1438

Closed aploshay closed 3 years ago

aploshay commented 3 years ago

The initialization line:

        @node_cache ||= NodeCache.new

suggests that the node cache might have been supplied through other means, but there's currently not possible; the proposed change allows for it.

This is a change we made within a project to fix a production bug in the component that built an arbitrarily large and deep set of nested OrderedList objects, before saving it -- without the ability to pass along an existing, paritlally-populated, node cache, we were getting collisions on ids once the whole set was persisted.