Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.6-beta.18] Unable to update subscription with a search query #9004

Closed
jb-cbd opened this issue Aug 11, 2017 · 3 comments
Closed

[1.6-beta.18] Unable to update subscription with a search query #9004

jb-cbd opened this issue Aug 11, 2017 · 3 comments

Comments

@jb-cbd
Copy link

jb-cbd commented Aug 11, 2017

Hello,

I'm having issues with a subscription where i'm operating a full text search in MongoDB.
(The search text is passed to the server as a parameter of the Meteor.subscribe function)

Here is how it's supposed to work :

  • On page load the search text is empty => the server returns all items in the collection
  • When the user types a query in the search form, this query is sent to the server, which returns a filtered publication
  • On client side, the items list is updated (with only items matching the searched word)

With Meteor 1.5.1 my code is working fine, but with Meteor 1.6-beta 18, i'm getting the following on the browser's console :

Uncaught Error: Expected not to find a document already present for an add at Object.update (http://localhost:3000/packages/mongo.js?hash=1cd846c44ae3ffa5db19ced8d6d332eb2a3b764b:235:19) at Object.store.(anonymous function) [as update] (http://localhost:3000/packages/ddp-client.js?hash=14d966b7972bd95a1f7015fec9ac340f10508a44:3733:60) at http://localhost:3000/packages/ddp-client.js?hash=14d966b7972bd95a1f7015fec9ac340f10508a44:4540:19 at Array.forEach (<anonymous>) at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149:11) at http://localhost:3000/packages/ddp-client.js?hash=14d966b7972bd95a1f7015fec9ac340f10508a44:4539:13 at Function._.each._.forEach (http://localhost:3000/packages/underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157:22) at Connection._performWrites (http://localhost:3000/packages/ddp-client.js?hash=14d966b7972bd95a1f7015fec9ac340f10508a44:4535:9) at Connection._flushBufferedWrites (http://localhost:3000/packages/ddp-client.js?hash=14d966b7972bd95a1f7015fec9ac340f10508a44:4522:10) at Connection._livedata_data (http://localhost:3000/packages/ddp-client.js?hash=14d966b7972bd95a1f7015fec9ac340f10508a44:4488:12) update @ collection.js:160 store.(anonymous function) @ livedata_connection.js:498 (anonymous) @ livedata_connection.js:1336 _.each._.forEach @ underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149 (anonymous) @ livedata_connection.js:1335 _.each._.forEach @ underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:157 _performWrites @ livedata_connection.js:1332 _flushBufferedWrites @ livedata_connection.js:1318 _livedata_data @ livedata_connection.js:1286 onMessage @ livedata_connection.js:273 (anonymous) @ stream_client_sockjs.js:174 _.each._.forEach @ underscore.js?hash=cde485f60699ff9aced3305f70189e39c665183c:149 self.socket.onmessage @ stream_client_sockjs.js:173 REventTarget.dispatchEvent @ sockjs-0.3.4.js:87 SockJS._dispatchMessage @ sockjs-0.3.4.js:1072 SockJS._didMessage @ sockjs-0.3.4.js:1130 that.ws.onmessage @ sockjs-0.3.4.js:1277

capture d ecran 2017-08-11 a 12 18 22

Here are the packages i'm using :
shell-server@0.2.4
check@1.2.5
http@1.2.12
fourseven:scss
session@1.1.7
vsivsi:file-collection
dynamic-import@0.1.1
react-meteor-data
twbs:bootstrap
static-html

Meteor app to reproduce the issue
https://github.com/jb-cbd/meteor-search-issue

@abernix
Copy link
Contributor

abernix commented Aug 11, 2017

Instead of pasting all your code into this issue, do you mind just creating a Meteor application with meteor create reproduction-app that demonstrates the problem and uploading that reproduction to GitHub? That way if someone wants to reproduce your problem, they can just run the app! 😃

@abernix abernix changed the title METEOR@1.6-beta.18 - Unable to update subscription with a search query [1.6-beta.18] Unable to update subscription with a search query Aug 11, 2017
@jb-cbd
Copy link
Author

jb-cbd commented Aug 11, 2017

Sure :)
Here is the app : https://github.com/jb-cbd/meteor-search-issue

@jb-cbd
Copy link
Author

jb-cbd commented Aug 16, 2017

The issue isn't happening anymore with 1.6-beta.21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants