You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This loop in postal.subscribe() is not dealing correctly with "this" binding and it is set to "window" in a callbacks, which results in this.cache being undefined and exception thrown.
// Next, add the SubscriptionDefinition to any relevant existing cache(s)
_.each( _.keys( this.cache ), function( cacheKey ) {
if ( cacheKey.substr( 0, channelLen ) === subDef.channel ) {
getCacher(
cacheKey.split( _config.cacheKeyDelimiter )[1],
this.cache,
cacheKey )( subDef );
}
}, this );
While I see numerous instances of saving "this" into "self" in other functions - subscribe() does not do it.
The text was updated successfully, but these errors were encountered:
They appear to have made a stab at fixing this in 1.0.10, but the fix has broken postal for us, resulting in duplicate subscriptions being invoked for a single publish. The fix they tried was to simply remove "this" from the call, but I suspect your idea of using "self" instead would be better.
@DylanTusler any chance you have an example of this causing duplicate subscription invocations? This isn't something I've run into yet, please let me know if it's happening and if you have an example case reproducing it, I'd love to take a look. thanks!
Sorry, I'm not with that company any more. It was so long ago that I'm a bit shaky on what we did to even work around it. I think we stuck with a version prior to 1.0.10.
This loop in postal.subscribe() is not dealing correctly with "this" binding and it is set to "window" in a callbacks, which results in this.cache being undefined and exception thrown.
While I see numerous instances of saving "this" into "self" in other functions - subscribe() does not do it.
The text was updated successfully, but these errors were encountered: