selfsdk 0.0.164 → 0.0.165

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/messaging.rb +16 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 37a0711ed0feb251165f49fcfdce3573cb3845dea3e02263395baada7af5d0f6
4
- data.tar.gz: dd281cf75f58dc8ff14e22a8e71e32b400aa78a7ea806038a33c9cb8d9bf61ac
3
+ metadata.gz: c98f4bd8df938f9c11acb72ffef83f231ddd0c1466c2b507975c5c3f1e4a8b58
4
+ data.tar.gz: 15109c43f84455b30215b905fdfa556a286a97e04da9c18e0ea7ae24bc69eecc
5
5
  SHA512:
6
- metadata.gz: 81ce8dcd9ebdbccfd0991b0479ddba10d46806588d660a4c7ace4f76cc534d62c7c3ef3074060989504b11a7876c51e66bb5ec780ddce889d780750cc5724e85
7
- data.tar.gz: 296412709b0ad51d9e4ee748d2116f07f940168aa00c7ad9494ff432fca532f81e7c996e833641c36417f94a319a82d012fa49665eb8b7f2e651b39419ba77b5
6
+ metadata.gz: 747b1019940113d76d2b2bf6e5b0fe39a7178f12dedabaa5b555b71aefdfe8e60d0dbe2658b467151a4df8985c48d695dcc622f2a4583ac28491190159c0a183
7
+ data.tar.gz: c8755a17be9aeed3d189b9116ad189c4e2bb24de1f9af594c1fe1196abad63ba24a1295958e2183e0845fcaf7a29592b62608440415198fa334efa36f8752534
data/lib/messaging.rb CHANGED
@@ -404,14 +404,22 @@ module SelfSDK
404
404
 
405
405
  # Authenticates current client on the websocket server.
406
406
  def authenticate
407
- SelfSDK.logger.info "authenticating"
408
- send_raw Msgproto::Auth.new(
409
- type: Msgproto::MsgType::AUTH,
410
- id: "authentication",
411
- token: @jwt.auth_token,
412
- device: @device_id,
413
- offset: @offset,
414
- )
407
+ res = wait_for 'authentication' do
408
+ SelfSDK.logger.info "authenticating"
409
+ send_raw Msgproto::Auth.new(
410
+ type: Msgproto::MsgType::AUTH,
411
+ id: "authentication",
412
+ token: @jwt.auth_token,
413
+ device: @device_id,
414
+ offset: @offset,
415
+ )
416
+ end
417
+
418
+ return res unless res.nil?
419
+
420
+ SelfSDK.logger.info "authentication timed out, retrying ..."
421
+ close
422
+ start_connection
415
423
  end
416
424
 
417
425
  def send_raw(msg)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: selfsdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.164
4
+ version: 0.0.165
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aldgate Ventures