Skip to content
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

Update matrixClient.http.authedRequest calls #27

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fnwbr
Copy link

@fnwbr fnwbr commented Mar 5, 2024

With matrix-org/matrix-js-sdk#2719 the signature of authedRequest has changed. They now do not expect a callback as the first parameter anymore.

All other parameters have just moved up by one.

With matrix-org/matrix-js-sdk#2719 the signature of `authedRequest` has changed. They now do not expect a callback as the first parameter anymore.

All other parameters have just moved up by one.
@fnwbr
Copy link
Author

fnwbr commented Mar 5, 2024

I have tested this locally with the latest matrix-js-sdk version 31.4.0; I don't recall which version number exactly changed the signature, but it must have happened somewhere around May 2023 when we already updated our authedRequest() calls in https://github.com/medienhaus/medienhaus-spaces:

matrix-org/matrix-js-sdk#2719 (reference)

@YousefED
Copy link
Owner

YousefED commented Mar 6, 2024

Thanks. Maybe we should also update the package json files to a version of matrix-js-sdk that you can confirm is working? I'm not actively working on matrix-crdt at this moment

@fnwbr
Copy link
Author

fnwbr commented Mar 27, 2024

I went ahead and pinned matrix-js-sdk to said version, which I had successfully tested the library with. I also made some adjustments to the TypeScript annotations where the JS SDK has changed in the meantime...

However, I wasn't able to fix all concerns. I guess lerna is also due for an update... maybe you or someone else will eventually find time to adjust the codebase. At the moment tests are failing and builds are broken. 😞

matrix-crdt: src/reader/MatrixReader.ts(123,19): error TS2532: Object is possibly 'undefined'.
matrix-crdt: src/reader/MatrixReader.ts(155,9): error TS2345: Argument of type '{ localTimeoutMs: number; }' is not assignable to parameter of type 'IRequestOpts & { doNotAttemptTokenRefresh?: boolean | undefined; }'.
matrix-crdt:   Property 'priority' is missing in type '{ localTimeoutMs: number; }' but required in type 'IRequestOpts'.
matrix-crdt: src/reader/MatrixReader.ts(201,13): error TS7022: 'res' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
matrix-crdt: src/util/authUtil.ts(9,9): error TS18048: 'client.crypto' is possibly 'undefined'.
matrix-crdt: src/util/authUtil.ts(41,3): error TS18048: 'client.crypto' is possibly 'undefined'.
matrix-crdt: src/util/authUtil.ts(42,22): error TS18048: 'client.crypto' is possibly 'undefined'.
matrix-crdt: src/util/authUtil.ts(43,21): error TS7052: Element implicitly has an 'any' type because type 'DeviceInfoMap' has no index signature. Did you mean to call 'keys.get'?
matrix-crdt: src/util/authUtil.ts(49,5): error TS18048: 'client.crypto' is possibly 'undefined'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants