Doctrine MongoDB ODM
  1. Doctrine MongoDB ODM
  2. MODM-22

Document incorrectly scheduled for update

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: 1.0.0ALPHA2
    • Component/s: Document Manager
    • Labels:
      None

      Description

      I have the following documents:

      Product:
      product_id
      sellable (dbref)

      Sellable:
      product (dbref)
      seller (dbref)

      Seller:
      name

      If I create a new Sellable for a seller the seller gets scheduled for update even if nothing has changed.The document persister correctly doesn't try to actually execute the update but Lifecycle events still get called. The flow is:

      1. Schedule for update
      2. Call _executeUpdate
      3. Call preUpdate
      4. Call BasicDocumentPersister::update(), which does nothing because of no actual changes
      5. Call postUpdate.

      preUpdate and postUpdate being called when there's no actual changes is causing problems. It seems like the proper course of action would be to either not schedule the document for update or check if there's any actual changes before calling preUpdate and postUpdate.

        Activity

        Hide
        Jonathan H. Wage added a comment -

        I will take a look at this. Can you try creating a test case that reproduces the issue?

        Show
        Jonathan H. Wage added a comment - I will take a look at this. Can you try creating a test case that reproduces the issue?
        Hide
        Jonathan H. Wage added a comment -

        Bulat, is this not fixed?

        Show
        Jonathan H. Wage added a comment - Bulat, is this not fixed?
        Hide
        Jonathan H. Wage added a comment -

        Any chance of a test case? Could you provide the documents you are using?

        Show
        Jonathan H. Wage added a comment - Any chance of a test case? Could you provide the documents you are using?

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Steven Surowiec
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: