-
-
Notifications
You must be signed in to change notification settings - Fork 600
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Retrying in Invalid date… #82
Comments
Hey @dogcalas can you share the whole debug info |
✔ Initializing whatsapp |
Same problem here. :( Any solution? ✔ Initializing whatsapp |
Just for the knowledge, I'm having the same problem, there is no error on the terminal. |
Same here. Once there are no incoming or outgoing messages for more than a few minutes, the above mentioned message is shown. |
Just gonna leave my notes here. Ran in console: l10n.localeStrings.en[0].filter(x=>x.includes('Retrying in'))
//result: ["Retrying in __duration__…", "Retrying in __number__ second…"] l10n.localeStrings.en[0].findIndex((x,y)=>x.includes('Retrying in'))
//result: 964 l10n.localeStrings.en[0].findIndex((x,y)=>x.includes('Retrying in __n'))
//result: 985 Now I use these indexes in the main app code to find out what results in the triggering of these 2 string identifiers to be rendered. Open https://web.whatsapp.com/app.9d707d8cc13bce7894d2.js in sources tab. Beutify. //ctrl+f: 964
//I'm now inside some sort of react component
//ref: "bafjeggiaj"
var s = this.state.retriable;
if (s) {
var c = m.default.retryTimestamp - Date.now();
if (c < 1)
n = l10n.t(963),
(0,
r.default)(function() {
return m.default.poke()
});
else if (c < 6e4) {
var l = Math.ceil(c / 1e3);
n = l10n.t(965, {
number: l,
_plural: l
})
} else
n = l10n.t(964, {
duration: i.default.duration(c).humanize()
})
} Looks like the invalid date is a result of c being humanized(). Doesn't look like a fundamental issue and the good news is WAWEB thinks it's still retriable. Let's figure out how we can get .humanize() to result in 'invalid date'. Pretty sure this is momentjs. Let's double check. //scroll up until we find the definition of i
i = v(n("dgdjiicfdg"))
//in console
const i = webpackJsonp([],null,["dgdjiicfdg"])
//returns: ƒ n(){return t.apply(null,arguments)}
//hmm ok this is a function
i()
//returns:
y {_isAMomentObject: true, _isUTC: false, _pf: {…}, _locale: O, _d: Mon Feb 03 2020 16:07:18 GMT+0000 (Greenwich Mean Time), …} Ok Based on this https://momentjscom.readthedocs.io/en/latest/moment/08-durations/03-humanize/#momentdurationhumanize moment.duration.invalid().humanize(); // Invalid Date hmm ok, so you have to explicitly force invalid date? No. If the moment date I am unable to recreate the issue. Now, @dogcalas @nicolaubrasil @CosmicSnow @ChrisB0701 Can you all please share the following information:
|
I believe this issue isn't related to invalid dates. When this error comes, can be seen in the browser an infinite attempts of ws connections, but they are all rejected. All connections attempts are closed by the server.
|
@dogcalas @ChrisB0701 Can you check in your network tab and see what the status code is of the WebSocket connection. Also, what is the status of your bots? I.e is it in production and being used heavily, just in local development etc.? |
@ChrisB0701 thanks. Few observations:
|
Seems so, but I can't figure out the reason. As I said - after restarting the script, the session is still valid and the connection is re-established.
Here is my debug info:
This is my create code:
Sorry, I'm no expert on the UA stuff. I copied the user agent info out of my chrome. Did I do something wrong here? |
As mentioned above, unfortunately the state does not change. Any idea on another way to identify this event? Then I could kill and restart the session. |
So I was not able to figure out the reason for this. I assume it is connected with the puppeteer environment: If I open wa web on the same machine in a regular chrome session without sulla and puppeteer, the connection is not lost. If I open wa web within sulla on the same machine and with the same wa account, the connection is lost and the above mentioned message is shown sooner or later. However, I'm using this workaround right now: Though the onStateChange method is not triggered, client.getConnectionState() returns "OPENING" once the "Retrying in..." screen appears. Thus, I'm regularly checking the connection state with getConnectionState() and as soon as it returns something different to "CONNECTED", I kill the session and restart the session again. I don't know, if this might help anyone with the same issue... |
@ChrisB0701 you can listen to state changes with this: https://github.com/smashah/sulla/blob/82ee145b9d83222aa506ff3bfc72a9aacd9164da/demo/index.ts#L43 |
I know, but for whatever reason, this event is not triggered when the "Retrying in..." screen appears. At least not in my setup... I don't know why. |
@ChrisB0701 can you join the discord so I can remote desktop with you since I'm not able to reproduce. Go to the sulla-hotfix channel |
I think, I had an error in my usage of the onStateChanged method. In my first implementation it was not firing anything at all. Now I got it working and since then there hasn't been any disconnects. There are regularly sequences of "OPENING - PAIRING - CONNECTED" but the connection has been re-established in all cases so far. I will keep you posted and let you know about the result, once there is another disconnect. Until then, I don't think I have to bother you in discord. :) But thanks anyway for the offer! |
@ChrisB0701 @dogcalas @CosmicSnow @nicolaubrasil Hi all, can you try new v.1.7.10 and let me know if this issue is fixed. Thanks |
Thank you @smashah, I will let you know. |
Thanks, @smashah! Actually I didn't have any disconnects in the last three days still using the old v.1.7.5. I don't know if there was any fix by WA. However, I will update to v.1.7.10 and let you know. |
I didn't have the "Retrying in... Invalid date" screen in the last two days. So I assume it's working now. Thank you @smashah very much for your great work in this project! I bought you some coffee! :) |
@ChrisB0701 awesome! your clue that helped me figure it out was:
Any unused listeners cause issues so in the middleware I will make sure only onMessage is present. Thanks for the coffee! Definitely needed it over the last few days! I'll close this for now. |
Sulla stop working after a while, nothing came out on console but chromium windows show a
"Retrying in Invalid date…" error.
Steps to reproduce the behavior:
sulla-hotfix version
"version": "1.6.15",
Whatsapp version
Debug Info { WA_VERSION: '0.4.315',
Screenshots
Host (please complete the following information):
The text was updated successfully, but these errors were encountered: