question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"AMQJS0007E Socket error:undefined" on wifi connection loss while trying to subscribe for topics

See original GitHub issue

Describe the bug I am trying to simulate a sudden connection loss, in between query and subscribe. Even though adding a try/catch block for subscribe(), still there’s an unhandled promise rejection.

To Reproduce Using an iOS simulator, after all query operations are successful, disconnect simulator from WiFi connection.

Expected behavior Since there was a network loss after query AND before or during the subscription process, observable’s error callback should be able to handle this socket connection error.

Screenshots screen shot 2019-01-28 at 4 29 35 pm

Desktop (please complete the following information):

  • OS: iOS
  • Browser Safari
  • Version 12.0.2

Smartphone (please complete the following information):

  • Device: iPhone 8 simulator
  • OS: iOS 12

Additional context I am using React Native. Using iPhone 8 simulator with debug mode enabled.

You can turn on the debug mode to provide more info for us by setting window.LOG_LEVEL = ‘DEBUG’; in your app.

screen shot 2019-01-28 at 4 49 35 pm

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
justinjoyncommented, Feb 18, 2020

Any update on this? I always get this error when trying to subscribe to a topic after internet is restored.

     "errorCode":7,
     "errorMessage":"AMQJS0007E Socket error:undefined."
1reaction
joseph-d-pcommented, Mar 12, 2019

@pranavgawri, so what I did as a workaround was let the React Native component listen for network connectivity change. If the network changed from offline to wifi, I subscribe again. Previous subscription channels with disconnected socket under the hood were closed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Connect failed: AMQJS0007E Socket error:undefined - HiveMQ
I tried MQTT Websocket Client to connect to a mosquitto broker/server. I got the error message: Connect failed: AMQJS0007E Socket ...
Read more >
MQTT+Mosquitto+Javascript in windows - Stack Overflow
Connection failed: AMQJS0007E Socket error:undefined. My Code is : <script type='text/javascript' src='jquery-1.10.1.js'></script> < ...
Read more >
Why can't FireFox connect to mosquitto via websocket on ...
When I set up mosquitto on Ubuntu 18.04, both FireFox and Chrome can ... errorCode: 7, errorMessage: "AMQJS0007E Socket error:undefined." }.
Read more >
408078 – Client throws exception on connect error - Bugs
LOG: Object {invocationContext: undefined, errorCode: 7, errorMessage: "AMQJS0007E Socket error:undefined."} In FF - If the server/port doesn't exist, ...
Read more >
WEB RTC feature sample app, connection failed - Forums - IBM
Object {invocationContext: undefined, errorCode: 7, errorMessage: "AMQJS0007E Socket error:undefined. This is the config that I am using: server:broker.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found