Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-5238

Add Feature Flag: Reloadable#reload_embedded_document doesn't respect session

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      def reload_embedded_document
      extract_embedded_attributes({}.merge(
      collection(_root).find(_root.atomic_selector).read(mode: :primary).first
      ))
      end

      This find call should be

      collection.find(atomic_selector, session: _session)

       

      as in the method call above it, causes the find to return nil during a transaction (where the record was created inside it, but it has yet to be committed) and then we merge in nil and raise error

            Assignee:
            neil.shweky@mongodb.com Neil Shweky (Inactive)
            Reporter:
            michael@brightbits.co.uk Michael Baldry
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: