Skip to content

Subscription onReady callbacks don't fire on a re-subscription with the same arguments inside Deps.autorun #1173

@athiwatc

Description

@athiwatc

_2 Upvotes_ I don't know if this is the intended behavior but lets assume that the server publish is setup.

Then we do

Deps.autorun ->
  Session.set('ready', false)
  Meteor.subscribe 'call-this', Session.get('something'), ->
    Session.set('ready', true)

Session.set('something', 2)
#wait for the subscibe to complete and the page shows
Session.set('something', 2)
#Now the loading page gets stuck. Note that the loading page uses {{#if}} against the 'ready' session.

I don't really have time to get an example working right now but I will try to if I get time.

My current hack/fix right now is adding a non-sense field to trick meteor on tearing and setting up the subscription and calling the on finish again.

Deps.autorun ->
  Session.set('ready', false)
  Meteor.subscribe 'call-this', Session.get('something'), Math.random(), ->
    Session.set('ready', true)

Session.set('something', 2)
#wait for the subscibe to complete and the page shows
Session.set('something', 2)
#Now the loading page gets stuck. Note that the loading page uses {{#if}} against the 'ready' session.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions