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

Stop fetching more report history twice onEndReached #2709

Merged
merged 1 commit into from
May 6, 2021

Conversation

marcaaron
Copy link
Contributor

@marcaaron marcaaron commented May 6, 2021

Details

Just noticed we were making double API requests to Report_GetHistory when reaching the end of a chat

Fixed Issues

Fixes #2708

Tests

  1. Scroll to the top of a chat that has greater than 50 comments while filtering the Network tab in Chrome Dev Tools for Report_GetHistory
  2. Verify that when we reach the top of a chat we are only calling Report_GetHistory once and cannot call it again while we are fetching new history.

Tip: On mobile I just added a log here to prove the API is only called once

diff --git a/src/libs/API.js b/src/libs/API.js
index be75675ec..840139b70 100644
--- a/src/libs/API.js
+++ b/src/libs/API.js
@@ -525,6 +525,7 @@ function Report_AddComment(parameters) {
  * @returns {Promise}
  */
 function Report_GetHistory(parameters) {
+    console.log('Calling Report_GetHistory');
     const commandName = 'Report_GetHistory';
     requireParameters(['reportID'],
         parameters, commandName);

QA Steps

  1. Verify loading new messages when reaching the end of chats works OK on various platforms.

Tested On

  • Web
  • Mobile Web - Can use Safari to test this in Simulator
  • Desktop
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@marcaaron marcaaron self-assigned this May 6, 2021
@marcaaron marcaaron marked this pull request as ready for review May 6, 2021 01:23
@marcaaron marcaaron requested a review from a team as a code owner May 6, 2021 01:23
@MelvinBot MelvinBot requested review from NikkiWines and removed request for a team May 6, 2021 01:23
Copy link
Contributor

@NikkiWines NikkiWines left a comment

Choose a reason for hiding this comment

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

Works well 👍

@NikkiWines NikkiWines merged commit 626cdf3 into main May 6, 2021
@NikkiWines NikkiWines deleted the marcaaron-paginationDoubleRequest branch May 6, 2021 20:49
@OSBotify
Copy link
Contributor

OSBotify commented May 6, 2021

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify
Copy link
Contributor

OSBotify commented May 7, 2021

🚀 Deployed to staging in version: 1.0.39-1🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 failure ❌
🕸 web 🕸 success ✅

@OSBotify
Copy link
Contributor

OSBotify commented May 8, 2021

🚀 Deployed to production in version: 1.0.39-5🚀

platform result
🤖 android 🤖 failure ❌
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onEndReached is called twice triggering 2 identical calls to Report_GetHistory
3 participants