Deployed prototype to Galaxy and autopublish seems to do nothing anymore


#1

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. :frowning: 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.


#2

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


#3

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?


#4

ah i see. thanks for clearing up the details @robfallows :slight_smile:


#5

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.