• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

zulip / zulip-mobile / 8113 / 1
65%
master: 65%

Build:
DEFAULT BRANCH: master
Ran 25 Jan 2019 02:15AM UTC
Files 364
Run time 38s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

25 Jan 2019 02:09AM UTC coverage: 65.697% (+0.01%) from 65.683%
COVERALLS_REPO_TOKEN=4eYQDtWoBJlDz2QkxoQ2UcnmJFcOB7zkv

push

travis-ci

gnprice
chat: Render `ComposeBox` only if `canSend`.

Fixes #3295.

If user can not send message in that narrow then it is better to not
render ComposeBox component at all.  This is the normal React pattern
for conditional rendering.

Since commit 824c908cc we've used instead a hack to make the component
render in React but not actually get displayed.  The motivation for
that, in turn, was that we had a hack using `componentDidMount` to
initialize the two TextInput components; and we'd been creating a
ComposeBox component but then having its `render` just return `null`,
so that hack wouldn't fire a second time if the compose box got
hidden, then unhidden again.

By putting ComposeBox itself inside the conditional render, we make it
so even that `componentDidMount` hack would work.  And meanwhile in
3ab1b7575 we recently removed that hack anyway in favor of passing
`defaultValue` to the input components.

---

Empirically, this fixes #3295.  Why is that, and how did we find
this fix?  A few observations on the issue:

* Only reproducible when compose box is shown after message loading
  (GIF like loader) after narrowing on Android.  Can't reproduce on
  narrows whose messages are cached and immediately visible after
  narrowing.

* If on the topic input (a) the `this.getCanSelectTopic()` condition
  is removed and (b) the `multiline` prop is set, it starts showing
  the issue, just like the message input.

So from this it can be inferred that:

* It is a `multiline` input issue, which occurs when its parent first
  got rendered with `display: none`.  Normally it is not reproducible
  on topic input because at the time of first render (when style is
  `display: none`), topic input is not rendered (because
  `this.getCanSelectTopic()` is false).

So to fix this issue, use the normal React pattern for conditional
rendering, so that the input component doesn't get created at all
until we want to show it.

1409 of 2929 branches covered (48.11%)

Branch coverage included in aggregate %.

4848 of 6595 relevant lines covered (73.51%)

16.66 hits per line

Source Files on job 8113.1 (COVERALLS_REPO_TOKEN=4eYQDtWoBJlDz2QkxoQ2UcnmJFcOB7zkv)
  • Tree
  • List 0
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 24342
  • Travis Job 8113.1
  • 6351c8e0 on github
  • Prev Job for COVERALLS_REPO_TOKEN=4eYQDtWoBJlDz2QkxoQ2UcnmJFcOB7zkv on master (#8111.1)
  • Next Job for COVERALLS_REPO_TOKEN=4eYQDtWoBJlDz2QkxoQ2UcnmJFcOB7zkv on master (#4157.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc