-
-
Notifications
You must be signed in to change notification settings - Fork 827
Conversation
Signed-off-by: Michael Telatynski <[email protected]>
…rix-org/matrix-react-sdk into t3chguy/m.relates_to
Seems like this is being built against the wrong |
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
FIXED |
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
…rix-org/matrix-react-sdk into t3chguy/m.relates_to
OK, so I've had a play with this, and seems really really cool 🙂 VERY cool to see permalinks that can link to entire discussions by just linking the last event in the thread (ignoring branching potential) I found a few bugs:
Also, I had some design-related thoughts. If there's already been a design decision then fair enough. If @lampholder or @ara4n have thoughts on my thoughts, that'd be useful:
|
FTR the tests fail because js-sdk |
is a thing I broke but will re-add |
Re
and
Design input welcome |
thats the whole boat of replies vs swimlanes (threading) |
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest running tests locally and making sure they pass.
|
||
sendMessagePromise.done((res) => { | ||
this.client.sendMessage(this.props.room.roomId, content).done((res) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Running tests locally, I found that this.client
might not be an object at this point.
It will always be an object as the constructor sets it as such, just that sinon overwrites it with a stub that doesn't have sendMessage |
Ah ok, looks like a simple fix of adding |
…ssage Signed-off-by: Michael Telatynski <[email protected]>
not quite, all the tests have to be refactored due to relying on checking whether the |
The tests pass! (locally) 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there!
@@ -916,9 +916,14 @@ module.exports = React.createClass({ | |||
|
|||
ContentMessages.sendContentToRoom( | |||
file, this.state.room.roomId, MatrixClientPeg.get(), | |||
).catch((error) => { | |||
).done(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"any unhandled rejection that ends up here will ... be thrown as an error" (see http://bluebirdjs.com/docs/api/done.html)
this should be catch(...).then(...)
} | ||
} | ||
|
||
static async getEvent(room, eventId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really think these statics should be defined after the constructor. That way, you can read down from componentWillMount
to initialize
instead of scrolling up through the statics.
</div> | ||
</div>; | ||
} | ||
} | ||
|
||
function dummyOnWidgetLoad() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe leave a comment explaining that onWidgetLoad should be made optional in EventTile
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski <[email protected]>
dis.dispatch({ | ||
action: 'message_sent', | ||
}); | ||
}).catch((error) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error could have been thrown in the then
. Ultimately we want two branches. One that is called if the call was successful, one otherwise.
In a sync world, you'd do:
try {
thingThatMightFail();
} catch (err) {
handle(err);
return;
}
success();
or equally with async await
. Perhaps just make the function async
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, have done; but cannot do the same for handleReturn
in MCI as it requires the boolean return type for Draft-js
…rix-org/matrix-react-sdk into t3chguy/m.relates_to
Signed-off-by: Michael Telatynski <[email protected]>
Signed-off-by: Michael Telatynski [email protected]
Requires matrix-org/matrix-js-sdk#607
Requires element-hq/element-web#6117
Fixes: