jdev - 2021-02-15


  1. pasdesushi has left

  2. pasdesushi has joined

  3. pasdesushi has left

  4. pasdesushi has joined

  5. pasdesushi has left

  6. pasdesushi has joined

  7. belong has left

  8. pasdesushi has left

  9. debacle has left

  10. belong has joined

  11. suohua has left

  12. paul has left

  13. suohua has joined

  14. asterix has left

  15. asterix has joined

  16. asterix has left

  17. asterix has joined

  18. SouL has left

  19. Vaulor has left

  20. Neustradamus has left

  21. kikuchiyo has left

  22. Neustradamus has joined

  23. Guus has left

  24. kikuchiyo has joined

  25. adityaborikar has left

  26. adityaborikar has joined

  27. mikeye has joined

  28. larma has joined

  29. mikeye has left

  30. mikeye has joined

  31. kikuchiyo has left

  32. kikuchiyo has joined

  33. fade123 has left

  34. Stefan has joined

  35. belong has left

  36. Yagizа has joined

  37. Stefan has left

  38. mikeye has left

  39. Vaulor has joined

  40. Stefan has joined

  41. mikeye has joined

  42. SouL has joined

  43. suohua has left

  44. belong has joined

  45. mikeye has left

  46. mikeye has joined

  47. Alex has left

  48. mikeye has left

  49. mikeye has joined

  50. suohua has joined

  51. paul has joined

  52. wurstsalat has joined

  53. fade123 has joined

  54. lovetox has left

  55. Stefan has left

  56. lovetox has joined

  57. Stefan has joined

  58. mikeye has left

  59. marmistrz has joined

  60. sonny has left

  61. Kev has joined

  62. mikeye has joined

  63. goffi has joined

  64. pulkomandy has left

  65. pulkomandy has joined

  66. marmistrz has left

  67. goffi has left

  68. goffi has joined

  69. mikeye has left

  70. pulkomandy has left

  71. pulkomandy has joined

  72. mikeye has joined

  73. marmistrz has joined

  74. pulkomandy has left

  75. pulkomandy has joined

  76. asterix has left

  77. asterix has joined

  78. mac has joined

  79. Alex has joined

  80. asterix has left

  81. asterix has joined

  82. asterix has left

  83. asterix has joined

  84. mac has left

  85. mikeye has left

  86. mikeye has joined

  87. asterix has left

  88. asterix has joined

  89. lovetox has left

  90. lovetox has joined

  91. adityaborikar has left

  92. mac has joined

  93. oibalos has joined

  94. floretta has left

  95. Daniel has joined

  96. adityaborikar has joined

  97. Daniel

    Does anyone know how I can set a timeout for the tcp socket in xmpp.js?

  98. Daniel

    whatever the default timeout for connection establishment is seems to be too low for my usecase

  99. mikeye has left

  100. asterix has left

  101. asterix has joined

  102. suohua has left

  103. mac has left

  104. adityaborikar has left

  105. Kev has left

  106. Kev has joined

  107. Kev has left

  108. Kev has joined

  109. suohua has joined

  110. suohua has left

  111. floretta has joined

  112. lovetox has left

  113. sonny has joined

  114. adityaborikar has joined

  115. lovetox has joined

  116. suohua has joined

  117. floretta has left

  118. Guus has joined

  119. sonny has left

  120. sonny has joined

  121. suohua has left

  122. lovetox has left

  123. lovetox has joined

  124. SouL has left

  125. SouL has joined

  126. SJM has joined

  127. paul has left

  128. Wojtek has joined

  129. alex-a-soto has left

  130. alex-a-soto has joined

  131. debacle has joined

  132. Zash has left

  133. Zash has joined

  134. floretta has joined

  135. asterix has left

  136. asterix has joined

  137. Sam Whited

    Does xmpp.js have literally no documentation except a readme with an example or two in some of the repos?

  138. COM8 has joined

  139. COM8 has left

  140. Sam Whited

    Daniel: this.Transport seems to have a Socket in it that I assume is a net.Socket which you can call setTimeout on https://nodejs.org/docs/latest-v15.x/api/net.html#net_socket_settimeout_timeout_callback

  141. Sam Whited

    No idea if that's ever exposed in an easier way though, I couldn't find a timeout option or anything

  142. Sam Whited

    The reconnect stuff has a timeout too, but again, no docs on how to set it that I can find.

  143. Daniel

    yes xmpp.js isn’t exaclty well documented. but from a quick research it is the only java script xmpp library that can do tcp

  144. Daniel

    yes i've started to suspect that the problem i ran into was actually the reconnect timeout. not the socket time out

  145. sonny has left

  146. sonny has joined

  147. COM8 has joined

  148. flow

    sonny, ↑

  149. Neustradamus has left

  150. pasdesushi has joined

  151. Neustradamus has joined

  152. fade123 has left

  153. asterix has left

  154. asterix has joined

  155. suohua has joined

  156. Sam Whited

    What's a good name for a package that's only purpose is to be used internally by devs to create other packages. Eg. lots of packages have something that sends and IQ, unmarshals the response into a value, etc. so this package would have the generic "SendIQ" logic that does all that, handles errors, etc. so that you don't have to rewrite it every time.

  157. COM8 has left

  158. Sam Whited

    But I can't for the life of me think of a package name that conveys "internal functions for contributors to make implementing XEPs easier"

  159. jonas’

    to me, sendIQ sounds like something which shouldn’t be a separate package but just part of the core api

  160. Sam Whited

    The core API does have that it just doesn't do all this extra stuff.

  161. defanor

    I think those usually go into something like "util" or "common", if it has to be generic.

  162. Sam Whited

    defanor: those don't really convey the intent, I generally think if you've created a package called "util" it's code smell and is just going to become an unmanageable dumping ground for random functions that should have been put somewhere else.

  163. Sam Whited

    Then again, maybe that's what that specific example function is.

  164. Sam Whited

    Yah, maybe if I'm having such trouble thinking of a name and defining what this package is for it's the same thing and I should think of somewhere else for this shared logic to go. I dunno, I'm struggling with this.

  165. Sam Whited

    Or maybe this particular example really should be core functionality even though it's sort of higher level than everything else. I just hate to add more IQ related methods to the session type which already has the confusingly named EncodeIQ, EncodeIQElement, SendIQ, and SendIQElement (which all do more or less the same thing with minor differences)

  166. Wojtek has left

  167. Wojtek has joined

  168. Wojtek has left

  169. paul has joined

  170. suohua has left

  171. Sam Whited

    jonas’: thinking about it more, you're absolutely right. This will be useful to more than just package authors and should be on the core session stuff.

  172. Sam Whited

    So I guess the question becomes "What should those methods be called?" I can never think what conveys the intent. "MarshalIQ" maybe? "MarshalAndDecodeIQ" is a bit long. I dunno.

  173. Sam Whited

    "RoundtripIQ"?

  174. Zash

    What does it do? Send an iq and return the response?

  175. Sam Whited

    More or less (as opposed to the existing SendIQ and EncodeIQ functions which just return the XML stream, this returns an actual concrete type that the user specified or an error representing the IQ error)

  176. Zash

    I think this is called SendIQ or similar in all libraries I've seen.

  177. sonny

    Daniel, setting a TCP timeout is not exposed publicaly but I'd be happy to implement that for you - meanwhile I can give you a workaround if you like

  178. Sam Whited

    Zash: SendIQ is already a thing, unfortunately. This is "HigherLevelSendIQ" :)

  179. Zash

    Naming things!

  180. Zash

    `await QueryResponse(SendIQ(···))` 🤷

  181. Sam Whited

    Maybe this is too high level for the main library. Eg. the http library doesn't unmarshal JSON for you, it just returns the body and you get to interpret it how you want. But then I'm back to not knowing where to put this.

  182. sonny

    Daniel, the documentation for reconnect is here https://github.com/xmppjs/xmpp.js/tree/master/packages/reconnect

  183. Daniel

    just so i understand. delay != timeout?

  184. Daniel

    so if i'm seeing a timeout error on connect it's probably the socket?

  185. sonny

    can you share the exact error?

  186. sonny

    (sounds like it yes)

  187. Wojtek has joined

  188. sonny

    not sure what the problem exactly is but you could try changing client.timeout - the default is 2000 (ms) which is probably too low

  189. suohua has joined

  190. Daniel

    sonny, what's that timeout being used for?

  191. sonny

    if you get a TimeoutError on `.start()` then that's the culprit

  192. sonny

    if you get a `TimeoutError` on `.start()` then that's the culprit

  193. sonny

    please open an issue with more details - it will be easier to figure out what the issue is and find out what needs to be documented

  194. sonny

    please open an issue with more details - it will be easier to figure out what the issue is and find out what needs to be documented or changed

  195. lovetox_ has joined

  196. lovetox_ has left

  197. mikeye has joined

  198. kikuchiyo has left

  199. fade123 has joined

  200. kikuchiyo has joined

  201. lovetox_ has joined

  202. marmistrz has left

  203. jubalh has joined

  204. jubalh has left

  205. mikeye has left

  206. Daniel has left

  207. Daniel has joined

  208. Daniel has left

  209. Daniel has joined

  210. marmistrz has joined

  211. marmistrz has left

  212. marmistrz has joined

  213. paul has left

  214. jubalh has joined

  215. Sam Whited

    Mocked it up and called it "MarshalIQ, MarshalIQElement, IterIQ, and IterIQElement"… that's a lot of new methods and it still feels wrong and confusingly named somehow (the extra "Iter" methods don't matter, I just realized that I'd need them too because a few things like roster fetches work differently and iterate over the children instead of just returning them all in one go like most IQs do)

  216. lovetox_ has left

  217. Sam Whited

    Organization is hard.

  218. asterix has left

  219. asterix has joined

  220. disgyze has joined

  221. asterix has left

  222. asterix has joined

  223. suohua has left

  224. jubalh has left

  225. adityaborikar has left

  226. Guus has left

  227. asterix has left

  228. Guus has joined

  229. asterix has joined

  230. disgyze has left

  231. disgyze has joined

  232. Wojtek has left

  233. paul has joined

  234. oibalos has left

  235. pasdesushi has left

  236. oibalos has joined

  237. asterix has left

  238. asterix has joined

  239. adityaborikar has joined

  240. Yagizа has left

  241. xecks has left

  242. xecks has joined

  243. marmistrz has left

  244. pasdesushi has joined

  245. marmistrz has joined

  246. adityaborikar has left

  247. pasdesushi has left

  248. pasdesushi has joined

  249. adityaborikar has joined

  250. oibalos has left

  251. oibalos has joined

  252. adityaborikar has left

  253. lovetox_ has joined

  254. belong has left

  255. goffi has left

  256. goffi has joined

  257. lovetox_ has left

  258. lovetox_ has joined

  259. lovetox_ has left

  260. lovetox_ has joined

  261. adityaborikar has joined

  262. floretta has left

  263. floretta has joined

  264. lovetox_ has left

  265. adityaborikar has left

  266. adityaborikar has joined

  267. belong has joined

  268. marmistrz has left

  269. jubalh has joined

  270. mikeye has joined

  271. paul has left

  272. paul has joined

  273. paul has left

  274. paul has joined

  275. asterix has left

  276. alex-a-soto has left

  277. alex-a-soto has joined

  278. asterix has joined

  279. fade123 has left

  280. mikeye has left

  281. oibalos has left

  282. goffi has left

  283. fade123 has joined

  284. paul has left

  285. paul has joined

  286. pasdesushi has left

  287. pasdesushi has joined

  288. pasdesushi has left

  289. pasdesushi has joined

  290. suohua has joined

  291. pasdesushi has left

  292. asterix has left

  293. asterix has joined

  294. adityaborikar has left

  295. wurstsalat has left

  296. pasdesushi has joined

  297. pasdesushi has left

  298. pasdesushi has joined

  299. pasdesushi has left