After deploying to Galaxy succesfully I checked my database and it had contents from my fixtures in it. Yay!
However, my prototype uses autopublish and insecure still (boo I know) and while locally in production mode I have no problems testing the user interface and data relationships, my galaxy deployment mini mongo is completely empty. Has anyone experienced this? Does a meteor bundle break the autopublishness of the autopublish package?
I checked the source and the autopublish package does seem to be bundled with the source but still all my collections on the client are empty.
Any helpful tips or advice would be appreciated.
autopublish and insecure are intentionally designed so they only work in development.
I for myself remove them right when i create a new project and donāt even use them in development.
https://www.meteor.com/tutorials/blaze/security-with-methods
https://www.meteor.com/tutorials/blaze/publish-and-subscribe
Thatās not actually the case. All these packages do is to add an equivalent āemptyā Package.autopublish
or Package.insecure
. Itās then down to other code to determine what to do if either of those keys is present. For example, the mongo package:
Nowhere in the mongo code is there a check for isProduction
or isDevelopment
(or any of the other equivalents).
Definitely! They will lead you down a dangerous path if youāre not careful.
So unless Galaxy itself is somehow supressing these (and I donāt think it is), thereās something else going on here. Forgive me if I ask the obvious question: have you confirmed that you have successfully connected to your external MongoDB instance?
ah i see. thanks for clearing up the details @robfallows
1 Like
Yes I can confirm I connected because my server fixtures ran and there was suddenly data in my database with mLab.
I agree I donāt want to use autopublish and insecure for very long but I was sharing the app with some pilot testers for a UAT and hadnāt put all my subscriptions and publish code in yet.
So as a work around I wrote a single publish function called null so it would send all the relevant data to all clients. That has got me working for now and in my next iteration I will have more publish and subscribe code.