Skip to content

object missing from query #27

@harry-73

Description

@harry-73

Hi,

I have a one .once publication and sometimes I have got this king of message:

Exception in delivering result of invoking 'myPublication': Error: object missing from query
    at LocalCollection._findInOrderedResults (local_collection.js:1275:9)
    at LocalCollection._updateInResultsSync (local_collection.js:1775:35)
    at LocalCollection._modifyAndNotifySync (local_collection.js:816:25)
    at local_collection.js:638:30
    at LocalCollection._eachPossiblyMatchingDocSync (local_collection.js:745:21)
    at LocalCollection.update (local_collection.js:632:10)
    at mergeIntoMinimongo (client.js:147:37)
    at subscribe.js:219:5
    at MethodInvoker._callback (meteor.js?hash=efab427f990044cd5eda0dccf88cdcc5b07b7197:1456:22)
    at MethodInvoker._maybeInvokeCallback (method_invoker.js:52:12)

Looking at LocalCollection._findInOrderedResults:

LocalCollection._findInOrderedResults = (query, doc) => {
  if (!query.ordered) {
    throw new Error('Can\'t call _findInOrderedResults on unordered query');
  }

  for (let i = 0; i < query.results.length; i++) {
    if (query.results[i] === doc) {
      return i;
    }
  }

  throw Error('object missing from query');
};

doc is the right object and query.results has the already docs in minimongo but there is no match.

It seems it is question of reference.

Modifying in mergeIntoMinimongo, merge(existingDoc, doc) by merge(doc, existingDoc) fixes the issue.

as it was before `0.5.1

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions