mirror of
https://github.com/RoboSats/robosats.git
synced 2024-12-14 03:16:24 +00:00
Small fixes, increase WS reconnection delay
This commit is contained in:
parent
8434a256cf
commit
8ae18f8b2a
@ -105,7 +105,6 @@ const EncryptedSocketChat: React.FC<Props> = ({
|
||||
connection.send({
|
||||
message: robot.pubKey,
|
||||
nick: userNick,
|
||||
authorization: `Token ${robot.tokenSHA256}`,
|
||||
});
|
||||
|
||||
connection.onMessage((message) => setServerMessages((prev) => [...prev, message]));
|
||||
@ -142,7 +141,6 @@ const EncryptedSocketChat: React.FC<Props> = ({
|
||||
connection.send({
|
||||
message: `-----SERVE HISTORY-----`,
|
||||
nick: userNick,
|
||||
authorization: `Token ${robot.tokenSHA256}`,
|
||||
});
|
||||
}
|
||||
// If we receive an encrypted message
|
||||
@ -214,7 +212,6 @@ const EncryptedSocketChat: React.FC<Props> = ({
|
||||
connection.send({
|
||||
message: value,
|
||||
nick: userNick,
|
||||
authorization: `Token ${robot.tokenSHA256}`,
|
||||
});
|
||||
setValue('');
|
||||
}
|
||||
@ -230,7 +227,6 @@ const EncryptedSocketChat: React.FC<Props> = ({
|
||||
connection.send({
|
||||
message: encryptedMessage.toString().split('\n').join('\\'),
|
||||
nick: userNick,
|
||||
authorization: `Token ${robot.tokenSHA256}`,
|
||||
});
|
||||
}
|
||||
})
|
||||
|
@ -276,7 +276,7 @@ export const useAppStore = () => {
|
||||
}, [delay, currentOrder, page, badOrder]);
|
||||
|
||||
const orderReceived = function (data: any) {
|
||||
if (data.bad_request != undefined) {
|
||||
if (data.bad_request) {
|
||||
setBadOrder(data.bad_request);
|
||||
setDelay(99999999);
|
||||
setOrder(undefined);
|
||||
|
@ -3,7 +3,12 @@ import { WebsocketConnection } from '..';
|
||||
|
||||
class WebsocketConnectionWeb implements WebsocketConnection {
|
||||
constructor(path: string) {
|
||||
this.rws = new ReconnectingWebSocket(path, [], { connectionTimeout: 15000 });
|
||||
this.rws = new ReconnectingWebSocket(path, [], {
|
||||
connectionTimeout: 15000,
|
||||
reconnectionDelayGrowFactor: 1.5,
|
||||
maxRetries: 15,
|
||||
maxReconnectionDelay: 1000000,
|
||||
});
|
||||
}
|
||||
|
||||
public rws: ReconnectingWebSocket;
|
||||
|
@ -160,7 +160,6 @@ class TokenAuthMiddleware(BaseMiddleware):
|
||||
dict((x.split("=") for x in scope["query_string"].decode().split("&")))
|
||||
).get("token_sha256_hex", None)
|
||||
token_key = hex_to_base91(token_key)
|
||||
print(token_key)
|
||||
except ValueError:
|
||||
token_key = None
|
||||
scope["user"] = (
|
||||
|
Loading…
Reference in New Issue
Block a user