Exposing subscriptionId as public?

Hi. I’m wondering about 2 things related to pub/sub and subscriptionId

  1. Why isn’t the subscriptionId ‘public’ from inside a publication callback? For example, if I do
    Meteor.publish(‘mypub’, function() {
    // is there a problem with referencing this._subscriptionId ?
    // I’m assuming that I shouldn’t reference it, because the leading underscore convention.
    // if not, can we get it added to typescript types?

  2. In the docs, Publish and subscribe | Meteor API Docs, subscriptionId should be public on the client side. For example, if I do
    const sub = Meteor.subscribe(‘mypub’)
    // I can safely reference sub.subscriptionId?
    If so, can we get that added to typescript types too? Right now, typescript complains that SubscriptionHandle does have a subscriptionId property.

The reason for all this is that I want to keep some of the subscription stuff in a structure on the server-side so I can reference it from another publication.


1 - what is the use case that you need the _subscriptionId in the server?

2 - I believe you can add this property yourself here. Read how to contribute for the types in the readme.