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

Cannot send a message #9370

Closed
bwindels opened this issue Apr 3, 2019 · 10 comments
Closed

Cannot send a message #9370

bwindels opened this issue Apr 3, 2019 · 10 comments
Labels
P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@bwindels
Copy link
Contributor

bwindels commented Apr 3, 2019

Loaded riot/develop, went around some rooms and tried to type in one without any effect. Pressed enter several times to try and send, then looked in the logs and saw errors, specifically the ones from logs-0000.log.gz in the rageshake:

TypeError: null has no properties
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/timeline-window.js/TimelineWindow.prototype.getEvents@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:36207:13
    _getEvents@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84992:22
    onMessageListFillRequest/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84234:221
From previous event:
    onMessageListFillRequest@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84225:66
    _maybeFill/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:82647:20
    tryCatcher@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:165973:16
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromiseFromHandler@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164114:13
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromise@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164171:13
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromise0@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164216:5
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromises@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164296:13
    _drainQueueStep@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161209:9
    _drainQueue@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161202:9
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[2]</Async.prototype._drainQueues@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161218:5
    Async/this.drainQueues@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161088:9
    run@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:322420:22
    notify/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:322437:30
    flush@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:318238:9
@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

Also pagination spinner that doesn't disappear:
cannotsend

@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

Wonder if this could be related to matrix-org/matrix-js-sdk#873...

@bwindels bwindels added S-Major Severely degrades major functionality or product features, with no satisfactory workaround 🔥 Fire 🔥 labels Apr 3, 2019
@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

refreshing fix it fwiw

@bwindels bwindels added the P1 label Apr 3, 2019
@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

First error seems to be:

Already have timeline for $1554223554110GTium:jki.re - joining timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.400Z to !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:46.200Z W %cUnhandled rejection Error: timeline already has a neighbouring timeline - cannot reset neighbour (direction: f)
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/models/event-timeline.js/EventTimeline.prototype.setNeighbouringTimeline@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:25157:15
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/models/event-timeline-set.js/EventTimelineSet.prototype.addEventsToTimeline@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:24588:13
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/client.js/</MatrixClient.prototype.paginateEventTimeline/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:5770:44
From previous event:
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/client.js/</MatrixClient.prototype.paginateEventTimeline@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:5762:9
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/timeline-window.js/TimelineWindow.prototype.paginate@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:36132:16
    onMessageListFillRequest@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84225:16
    _maybeFill/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:82647:20
    tryCatcher@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:165973:16
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromiseFromHandler@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164114:13
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromise@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164171:13
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromise0@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164216:5
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromises@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164296:13
    _drainQueueStep@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161209:9
    _drainQueue@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161202:9
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[2]</Async.prototype._drainQueues@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161218:5
    Async/this.drainQueues@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161088:9
    run@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:322420:22
    notify/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:322437:30
    flush@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:318238:9 color: red

with right after multiple of these:

2019-04-03T06:48:46.200Z E timeline is null
TypeError: timeline is null
    ../../ReactSDKDevelop/workspace/matrix-js-sdk/lib/timeline-window.js/TimelineWindow.prototype.getEvents@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:36207:13
    _getEvents@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84992:22
    onMessageListFillRequest/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84234:221
From previous event:
    onMessageListFillRequest@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:84225:66
    _maybeFill/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:82647:20
    tryCatcher@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:165973:16
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromiseFromHandler@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164114:13
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromise@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164171:13
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromise0@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164216:5
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[22]</module.exports/Promise.prototype._settlePromises@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:164296:13
    _drainQueueStep@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161209:9
    _drainQueue@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161202:9
    ./matrix-react-sdk/node_modules/bluebird/js/browser/bluebird.js/</</<[2]</Async.prototype._drainQueues@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161218:5
    Async/this.drainQueues@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:161088:9
    run@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:322420:22
    notify/<@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:322437:30
    flush@https://riot.im/develop/bundles/568d456ab128634d0cfb/bundle.js:318238:9

@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

Already have timeline for $1554223554110GTium:jki.re - joining timeline, this event was right before the last event visible in the timeline btw.

@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

Even earlier in the log

2019-04-03T06:48:43.400Z I Request to reset timeline in room  !WCHwNGGsrVwPeRtAnq:matrix.org  viewing: !WCHwNGGsrVwPeRtAnq:matrix.org

And then these (the lant.uk events seem to be state events that riot does not render by a bot):

2019-04-03T06:48:43.600Z I Already have timeline for $155422320012398FAbyl:lant.uk - joining timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:38.400Z to !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422290112396PcTJf:lant.uk already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422260212393IujJW:lant.uk already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422238759227SCDce:matrix.org already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422238459214SoznS:matrix.org already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422237659175NyOnQ:matrix.org already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422230412387SjEIH:lant.uk already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422200012381NObIF:lant.uk already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z
2019-04-03T06:48:43.600Z I Event $155422170012378NsrSb:lant.uk already in timeline !WCHwNGGsrVwPeRtAnq:matrix.org:2019-04-03T06:48:43.600Z

@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

So, AFAICT, the following is happening for room !WCHwNGGsrVwPeRtAnq:matrix.org:

  1. user is viewing the room
  2. sync comes in and sees gap, resets timeline (request to reset enitre timeline set is granted because I was scrolled down?)
  3. the scrollpanel tries to paginate more events in at the top, ends up doing a backwards fill on the live timeline and calling /messages
  4. once the result for that comes in, it tries to add those events to the live timeline
  5. somehow, one of the events in the response is already in an existing timeline (this would mean _eventIdToTimeline in EventTimelineSet didn't get reset, so in step 2 the entire timeline set wasn't reset, just the live timeline? Also, why don't the new and old live timeline get linked up when doing a non-entire set reset?)
  6. we try to link up the live timeline and the existing one. Setting the previous neighbour on the live timeline seems to succeed, but once we try to set the next timeline on the existing timeline, it throws because it already has a next neighbour.
  7. ...
  8. somehow this._start.timeline in the TimelineWindow ends up being null, and re-rendering the timeline fails completely.

@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

This feels related to #8593, wdyt @turt2live ?

@bwindels
Copy link
Contributor Author

bwindels commented Apr 3, 2019

Might also be fixed by matrix-org/matrix-js-sdk#877

@turt2live
Copy link
Member

I think your primary problem is covered in #8593 (comment) (by the logging added in matrix-org/matrix-js-sdk@5c8890c) - Closing as a duplicate of that.

The remainder of your symptoms seem to be timeline is null blowing up React, causing a total crash and weird stuff like spinners that won't go away, inability to switch rooms, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

No branches or pull requests

2 participants