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

Implemented XEP-0106 JID Escaping Transformations for Matrix room IDs #91

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rakaar
Copy link

@rakaar rakaar commented Jan 26, 2020

Implemented XEP-0106 Escaping transformations as mentioned in #83 as per this document in the file src/MatrixRoomHandler.ts. This is done using a function by name XEP0106_APPLY_ESCAPING_TRANSFORMATIONS at the top of the file after imports.

To ensure, nothing is broken, I have run the command npm run test, which resulted in all tests passed.

Copy link
Collaborator

@Half-Shot Half-Shot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thank you! One thing to mention is that it would be nice to see some test cases written up as unit tests. It should be easy because the function is static and hasno dependencies.

src/MatrixRoomHandler.ts Outdated Show resolved Hide resolved
src/MatrixRoomHandler.ts Outdated Show resolved Hide resolved
src/MatrixRoomHandler.ts Outdated Show resolved Hide resolved
src/MatrixRoomHandler.ts Outdated Show resolved Hide resolved
@rakaar
Copy link
Author

rakaar commented Jan 26, 2020

@Half-Shot
Made the changes as you requested.

it would be nice to see some test cases written up as unit tests. It should be easy because the function is static and has no dependencies

Do you want me to write unit tests?

@Half-Shot
Copy link
Collaborator

Yes please :)

@rakaar
Copy link
Author

rakaar commented Jan 28, 2020

@Half-Shot
I have tried writing tests related to JID escaping in a seperate file test/test_matrixroomhandler.ts,
But when I run them, I face this error: SyntaxError: Octal escape sequences are not allowed in strict mode.
I have also included /* tslint:disable */ and also // tslint:disable: no-any at the beginning of the file. But the error persists.
What can I do to run the tests smoothly?
Here is a screenshot of the error I am getting
Screenshot from 2020-01-28 23-45-28

@Half-Shot
Copy link
Collaborator

Would you mind commuting your changes anyway, so I can take a look.

@Half-Shot
Copy link
Collaborator

Just noticed, could you remove the package-lock.json file from your PR. We use yarn (which uses yarn.lock).

@rakaar rakaar force-pushed the xep-transformation branch from 89915a2 to b01024b Compare January 31, 2020 04:55
@rakaar
Copy link
Author

rakaar commented Jan 31, 2020

@Half-Shot
I have squashed my commits into one.
The XEP0106_ESCAPING_TRANSFORMATIONS object contains the one, mentioned in #83 issue, and for test cases, I took the roomId reference here and examples mentioned in the document. I have run the test cases and all of them have passed, including the once I newly wrote.

@rakaar
Copy link
Author

rakaar commented Feb 2, 2020

@Half-Shot
Is there anything else, that I am missing. If yes then please let me know. I would update the PR.

@Neustradamus
Copy link

@rakaar, @Half-Shot: Any news?

@jaller94 jaller94 linked an issue May 20, 2022 that may be closed by this pull request
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.

Implement XEP-0106: JID Escaping
3 participants