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

Thread store and event parsing to create threads #1828

Merged
merged 12 commits into from
Aug 31, 2021

Conversation

germain-gg
Copy link
Contributor

@germain-gg germain-gg commented Aug 4, 2021

This is a first implementation for thread in the js-sdk. There is currently no UI associated yet but will follow shortly

Given that the concept of thread will be completely client-side for now, references to the root and tails of the thread are kept, to be able to rebuild the reply chain upon a refresh or so that it can be synchronized between multiple clients

EV1 (root)
 |
 |
EV2
 |\__
 |   \ 
EV3   EV4 (tail)
 |
EV5 (tail)

@germain-gg germain-gg requested a review from a team August 4, 2021 15:23
@germain-gg germain-gg force-pushed the gsouquet/threaded-messaging-2349 branch from e9f3d13 to 1811390 Compare August 4, 2021 15:28
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

Generally it looks sane, though a couple things: is this meant to be unstable functionality? If so, annotating the functions aggressively with unstable warnings would be appreciated (to allow for breaking changes during development / discouraging use until it's ready).

More documentation on the public fields/functions would be appreciated as well, to help with understanding and those who use this thing outside of us.

spec/unit/models/thread.spec.ts Outdated Show resolved Hide resolved
src/models/event.ts Outdated Show resolved Hide resolved
Copy link
Member

@turt2live turt2live left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

@@ -146,7 +146,7 @@ export class Room extends EventEmitter {
public oldState: RoomState;
public currentState: RoomState;

private threads = new Set<Thread>();
public threads = new Set<Thread>();
Copy link
Member

Choose a reason for hiding this comment

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

it's a little dangerous exposing this publicly, but not the end of the world. Can it get some jsdoc to guide the developer on using it safely? (ie: is it safe to mutate, or should it be treated as readonly?)

@germain-gg germain-gg merged commit 7e2458d into develop Aug 31, 2021
@germain-gg germain-gg deleted the gsouquet/threaded-messaging-2349 branch August 31, 2021 08:19
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