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

Fix row rendering in infinite scroll #8060

Merged
merged 14 commits into from
Sep 10, 2024

Conversation

Swiddis
Copy link
Contributor

@Swiddis Swiddis commented Sep 6, 2024

Description

When rendering infinite scrolling PPL/SQL in the new Discover UI, the rendering was stalling and entering an infinite loading loop. The root cause turns out to be that there's a small amount of fade-out at the bottom of the OSD application:

image

This was causing an issue with the progress bar observer responsible for loading the next batch of rows: it had threshold: 1.0 set which meant that it would only trigger if the progress bar is 100% visible. This isn't a problem for DQL where large amounts of data records have a limit disclaimer at the bottom:

image

But when that disclaimer isn't present (for PPL and SQL), this fade effect would cover the progress bar, causing it not to meet the 1.0 threshold:

image

In addition to fixing the bug, this PR adds a batch of unit tests for the discover table.

Issues Resolved

N/A

Screenshot

After reaching the end of the available records:

image

Testing the changes

The PR features a new set of unit tests for the involved functionality, but given the nature of the bug it's hard to test the fault directly (we would need to mock the entire OSD application and assert that the intersection threshold is > 0.5 when we scroll to the end). Theoretically possible, but probably too much effort for a one-line fix.

Changelog

  • fix: Fix row rendering in Discover infinite scroll

Check List

  • All tests pass
    • yarn test:jest
    • yarn test:jest_integration
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

Copy link
Contributor

github-actions bot commented Sep 6, 2024

ℹ️ Manual Changeset Creation Reminder

Please ensure manual commit for changeset file 8060.yml under folder changelogs/fragments to complete this PR.

If you want to use the available OpenSearch Changeset Bot App to avoid manual creation of changeset file you can install it in your forked repository following this link.

For more information about formatting of changeset files, please visit OpenSearch Auto Changeset and Release Notes Tool.

Copy link

codecov bot commented Sep 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 63.83%. Comparing base (22f1d46) to head (2e815cb).
Report is 62 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8060      +/-   ##
==========================================
+ Coverage   63.71%   63.83%   +0.12%     
==========================================
  Files        3738     3738              
  Lines       88682    88684       +2     
  Branches    13788    13789       +1     
==========================================
+ Hits        56501    56614     +113     
+ Misses      31593    31476     -117     
- Partials      588      594       +6     
Flag Coverage Δ
Linux_1 29.96% <33.33%> (+<0.01%) ⬆️
Linux_2 58.79% <ø> (ø)
Linux_3 40.25% <100.00%> (+0.19%) ⬆️
Linux_4 31.20% <ø> (ø)
Windows_1 29.97% <33.33%> (+<0.01%) ⬆️
Windows_2 58.74% <ø> (ø)
Windows_3 40.25% <100.00%> (+0.19%) ⬆️
Windows_4 31.20% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Sep 6, 2024

❌ Invalid Prefix For Manual Changeset Creation

Invalid description prefix. Found "fix". Only "skip" entry option is permitted for manual commit of changeset files.

If you were trying to skip the changelog entry, please use the "skip" entry option in the ##Changelog section of your PR description.

Signed-off-by: Simeon Widdis <[email protected]>
@Swiddis Swiddis marked this pull request as ready for review September 6, 2024 23:17
Comment on lines +267 to +276
<EuiProgress
size="xs"
color="accent"
data-test-subj="discoverRenderedRowsProgress"
style={{
// Add a little margin if we aren't rendering the truncation callout below, to make
// the progress bar render better when it's not present
marginBottom: rows.length !== sampleSize ? '5px' : '0',
}}
/>
Copy link
Member

Choose a reason for hiding this comment

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

Why arent we adding the truncation banner for PPL and SQL?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That would require being able to get the active selected language in-context since PPL and SQL have a different default number of records they return when they have no limit configured, I briefly tried to follow the stack trace to see if I could pass that context down but couldn't find where it exists. Figured fixing the core bug was more important than the bells & whistles for this PR, could look at it for a future PR.

Copy link
Member

@ashwin-pc ashwin-pc left a comment

Choose a reason for hiding this comment

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

Thanks Simeon!

Copy link
Member

@sejli sejli left a comment

Choose a reason for hiding this comment

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

LGTM, I reran the build and test workflow that failed. I don't think it's related to your changes, but will wait for that before merging first.

@joshuali925 joshuali925 merged commit fbac07b into opensearch-project:main Sep 10, 2024
66 of 67 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 10, 2024
Signed-off-by: Simeon Widdis <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit fbac07b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 10, 2024
Signed-off-by: Simeon Widdis <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
(cherry picked from commit fbac07b)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
joshuali925 pushed a commit that referenced this pull request Sep 10, 2024
(cherry picked from commit fbac07b)

Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
abbyhu2000 pushed a commit that referenced this pull request Sep 10, 2024
(cherry picked from commit fbac07b)

Signed-off-by: Simeon Widdis <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants