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

error invoking SubsManager.subscribe: undefined #77

Open
markshust opened this issue May 20, 2016 · 1 comment
Open

error invoking SubsManager.subscribe: undefined #77

markshust opened this issue May 20, 2016 · 1 comment

Comments

@markshust
Copy link

markshust commented May 20, 2016

I receive this error when listening to subscribe within react-komposer onChange, for example:

const onChange = ({ areaId, sectionId }, onData) => {
  subs.subscribe('area.list');
  subs.subscribe('company.detail');
  subs.subscribe('item_to_section.list');
  subs.subscribe('section.list');

  if (subs.ready()) {
  ...

It appears this happens because these are all authenticated routes, and on initial load, user is not yet authenticated. Since I'm handling auth logic through Tracker Autorun, the container component is attempting to load these subscriptions, but they are returning undefined, causing an error in the browser console:

screen shot 2016-05-20 at 12 38 53 pm

Is there any way to prevent this error from being logged? This happens not only for anonymous users, but also when a user logs out.

@markshust
Copy link
Author

Looking at the code, it appears its just a console log, and not an actual error going on. Perhaps it would just be best to eliminate the console.log, as it's not really needed?

  function errorHandlingLogic (err) {
    console.log("Error invoking SubsManager.subscribe(%s): ", sub.identifier , err.reason);
    // expire this sub right away.
    // Then expiration machanism will take care of the sub removal
    sub.updated = new Date(1);
  }

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

1 participant