!jiRZORhJXxYobcAysp:matrix.org

Matrix JS SDK

134 Members
Unofficial discussion for the Matrix JS SDK library | https://github.com/matrix-org/matrix-js-sdk33 Servers

Load older messages


SenderMessageTime
8 Nov 2023
@puneet_nanda:matrix.orgPuneet NandaI am still getting the same errors with matrix.org. The strange thing is the same thing is implemented in react js webApp but we are not getting any params there like ?&=1699443071324.11:38:01
@daedric:aguiarvieira.ptRicardo DuarteCan you show us the code that generated that request ?11:38:42
@puneet_nanda:matrix.orgPuneet Nanda

import * as sdk from 'matrix-js-sdk';
const createClient = async () => {
try {
const clientOptions = {
baseUrl: MATRIX_SERVER,
};
matrixClient = sdk.createClient(clientOptions);
console.log(matrixClient, 'matrix Client');
isCreated = true;
return true;
} catch (error) {
console.error('Error while creating client:', error);
return false;
}
};

const connect = async () => {
    try {
        if (!isCreated) {
            await createClient();
        }
        await matrixClient.startClient({ initialSyncLimit: 100000 });
        isConnected = true;
        return isConnected;
    } catch (error) {
        console.error('Error while connecting:', error);
        isConnected = false;
        return isConnected; // Return false to indicate that the connection failed.
    }
};

const checkSyncedClient = async (setClientSynced) => {
    setTimeout(() => {
        matrixClient.once('sync', function (state, prevState, res) {
            if (state === 'PREPARED') {
                console.log('account data prepared');
                setClientSynced();
            }
            if (state === 'ERROR') {
                checkSyncedClient(setClientSynced);
            }
        });
    }, 2000);
};

I am using these methods initially to setup Matrix Client.

11:43:46
@daedric:aguiarvieira.ptRicardo DuartebaseUrl: MATRIX_SERVER, <-- 11:53:54
@daedric:aguiarvieira.ptRicardo DuarteCan you show what's stored in this var ?11:54:00
@puneet_nanda:matrix.orgPuneet Nandaexport const MATRIX_SERVER = "https://matrix.org/"11:58:55
@daedric:aguiarvieira.ptRicardo DuarteCould you possibly try without the last / ?12:00:42
@puneet_nanda:matrix.orgPuneet NandaI tried but got the same result.12:01:37
@daedric:aguiarvieira.ptRicardo DuarteI'm out of ideas... 😕12:05:02
9 Nov 2023
@asbjorn:olli.ngA2 changed their display name from Asbjørn to A2.18:03:03
15 Nov 2023
@bhuhhajjnf:matrix.org@bhuhhajjnf:matrix.org joined the room.05:17:49
@bhuhhajjnf:matrix.org@bhuhhajjnf:matrix.org left the room.06:44:47
25 Nov 2023
@bobby123:envs.netbobby123 joined the room.16:31:29
@bobby123:envs.netbobby123 why can matrixClient .getUser(myUserId)!.avatarUrl; return null? 18:43:21
@bobby123:envs.netbobby123 * why can matrixClient.getUser(myUserId)!.avatarUrl; return null? 18:43:27
@daedric:aguiarvieira.ptRicardo DuarteIf there's no avatar... .what should it return ?18:52:50
@bobby123:envs.netbobby123no I mean, if I'm logged in my avatar should be available no>?18:53:58
@bobby123:envs.netbobby123 * no I mean, if I'm logged in my avatar should be available no?18:53:59
@bobby123:envs.netbobby123 for some reason it keeps returning null 18:54:04
@bobby123:envs.netbobby123oh ...18:54:08
@bobby123:envs.netbobby123I have no avatar :P18:54:11
@bobby123:envs.netbobby123my bad!18:54:13
@daedric:aguiarvieira.ptRicardo DuarteI just died a little..18:54:43
@bobby123:envs.netbobby123 set a profile picture.18:54:44
@bobby123:envs.netbobby123
In reply to @daedric:aguiarvieira.pt
I just died a little..
I just wasted a few hours of my day :D
18:54:57
@bobby123:envs.netbobby123 changed their profile picture.23:55:12
30 Nov 2023
@finlifin:matrix.org@finlifin:matrix.org left the room.15:32:54
11 Dec 2023
@north:nullpointer.latNorth joined the room.03:43:22
@north:nullpointer.latNorthGuys, few questions, how do I make the bot decrypt and read messages?03:44:03
@north:nullpointer.latNorthFor some reason I try client._crypt.decryptEvent(message) and it seems to trigger an error saying 03:45:16

Show newer messages


Back to Room ListRoom Version: 5