Skip to content

[IMPROVEMENT] Native sort and limit queries#2249

Merged
diegolmello merged 31 commits intodevelopfrom
improvement.sort-native
Jul 20, 2020
Merged

[IMPROVEMENT] Native sort and limit queries#2249
diegolmello merged 31 commits intodevelopfrom
improvement.sort-native

Conversation

@diegolmello
Copy link
Copy Markdown
Member

@diegolmello diegolmello commented Jul 7, 2020

@RocketChat/ReactNative

This PR makes usage of new WatermelonDB's experimental APIs for sort, take and skip.

Comparison

  • 30~40 MB less memory consumption loading a RoomView with 3k messages on local db
  • 10 MB less memory loading RoomsListView with 500 channels
  • 8 MB less memory on ShareListView with 500 channels

Test plan

A

  • RoomsListView should load 50 channels at time
  • When grouping (by type or whatever), it should load all channels and sort native

B

  • RoomView should load 50 message at time

C

  • ShareListView should load 50 channels at time
  • Search should by limited to 50 channels

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 7, 2020

This pull request introduces 1 alert and fixes 1 when merging ded2d72 into 20604c4 - view on LGTM.com

new alerts:

  • 1 for Direct state mutation

fixed alerts:

  • 1 for Direct state mutation

@diegolmello diegolmello force-pushed the improvement.sort-native branch from bfb635d to 65d7dc1 Compare July 9, 2020 20:52
@diegolmello diegolmello force-pushed the improvement.sort-native branch from 65d7dc1 to 39f79bc Compare July 9, 2020 20:56
@diegolmello diegolmello mentioned this pull request Jul 9, 2020
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 9, 2020

This pull request introduces 1 alert and fixes 1 when merging 39f79bc into f3b02a6 - view on LGTM.com

new alerts:

  • 1 for Direct state mutation

fixed alerts:

  • 1 for Direct state mutation

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (develop@146babc). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop    #2249   +/-   ##
==========================================
  Coverage           ?   70.12%           
==========================================
  Files              ?      104           
  Lines              ?     1928           
  Branches           ?      312           
==========================================
  Hits               ?     1352           
  Misses             ?      426           
  Partials           ?      150           
Impacted Files Coverage Δ
storybook/stories/index.js 100.00% <ø> (ø)
app/containers/Toast.js 70.00% <0.00%> (ø)
app/views/Styles.js 100.00% <0.00%> (ø)
app/lib/utils.js 28.57% <0.00%> (ø)
app/containers/UIKit/Divider.js 100.00% <0.00%> (ø)
app/containers/markdown/BlockQuote.js 100.00% <0.00%> (ø)
app/containers/UIKit/MultiSelect/Chips.js 78.94% <0.00%> (ø)
app/containers/UIKit/MultiSelect/styles.js 100.00% <0.00%> (ø)
app/utils/url.js 100.00% <0.00%> (ø)
storybook/stories/UiKitMessage.js 100.00% <0.00%> (ø)
... and 95 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 146babc...aa08ff0. Read the comment docs.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 10, 2020

This pull request introduces 1 alert and fixes 1 when merging aa08ff0 into 146babc - view on LGTM.com

new alerts:

  • 1 for Direct state mutation

fixed alerts:

  • 1 for Direct state mutation

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 10, 2020

This pull request introduces 1 alert and fixes 1 when merging ee74550 into 146babc - view on LGTM.com

new alerts:

  • 1 for Direct state mutation

fixed alerts:

  • 1 for Direct state mutation

@diegolmello diegolmello mentioned this pull request Jul 17, 2020
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 17, 2020

This pull request introduces 1 alert and fixes 1 when merging 693e454 into 52b82e5 - view on LGTM.com

new alerts:

  • 1 for Direct state mutation

fixed alerts:

  • 1 for Direct state mutation

@diegolmello diegolmello merged commit 9dbe10b into develop Jul 20, 2020
@diegolmello diegolmello deleted the improvement.sort-native branch July 20, 2020 16:44
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Jul 20, 2020

This pull request introduces 1 alert and fixes 1 when merging d2463bc into 9882ace - view on LGTM.com

new alerts:

  • 1 for Direct state mutation

fixed alerts:

  • 1 for Direct state mutation