fix(bitswap/client): dont set nil for DontHaveTimeoutConfig#872
fix(bitswap/client): dont set nil for DontHaveTimeoutConfig#872
Conversation
guillaumemichel
left a comment
There was a problem hiding this comment.
Thanks @Wondertan!
There was a problem hiding this comment.
Actually, since bs.dontHaveTimeoutConfig is only used to define peerQueueFactory, setting it to nil should have no effect on the closure previously defined. This looks like a memory optimization.
Any opinions @gammazero?
|
@guillaumemichel, closure takes value from Client struct tho, so this nil sets the config entirely to zero even if its set. The DontHaveTimeout component then makes a default value silently if nil is given, so in the end DontHaveTimeout component works but with default config even when user passes a modified config. This is the reason why I was going "nuts". I spent too much time debugging the config and my understanding of Bitswap code there, while this was an issue... |
The values inside in the function are not evaluated until the function is run, so when |
|
should we make it skipchangelog? |
I think it would be good make a note that we no longer ignore DontHaveTimeoutConfig. If there is a change in functionality or in the way something is used, then it should be noted in change log. I think this qualifies. |
I thought I was going nuts... That's not even funny.