From f2f47408cfcd54ffc9d21ceed4e40aeebb10b09d Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 28 Jun 2022 22:23:55 +0100 Subject: [PATCH 01/39] start --- src/libs/actions/Report.js | 55 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 9710e0382980..263312baa1d7 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -27,6 +27,7 @@ import * as ReportActions from './ReportActions'; import Growl from '../Growl'; import * as Localize from '../Localize'; import PusherUtils from '../PusherUtils'; +import {read} from "../API"; let currentUserEmail; let currentUserAccountID; @@ -1143,6 +1144,60 @@ function saveReportComment(reportID, comment) { Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`, comment); } +/** + * Open a report + * + * @param {String} reportID + * @returns {Promise} + */ +function openReport(reportID) { + const sequenceNumber = reportMaxSequenceNumbers[reportID]; + API.read('OpenReport', + { + reportID, + }, + { + optimisticData: [{ + onyxMethod: 'merge', + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + history: [], + unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), + lastVisitedTimestamp: Date.now(), + }, + }], + successData: [], + failureData: [], + }); +} + +/** + * Open a report + * + * @param {String} reportID + * @returns {Promise} + */ +function readOldestAction(reportID) { + const sequenceNumber = reportMaxSequenceNumbers[reportID]; + API.read('ReadOldestAction', + { + reportID, + history, + }, + { + optimisticData: [{ + onyxMethod: 'merge', + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), + lastVisitedTimestamp: Date.now(), + }, + }], + successData: [], + failureData: [], + }); +} + /** * Immediate indication whether the report has a draft comment. * From 963fcc9732c9b965287f155ead6aee4a503dac6f Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 29 Jun 2022 15:53:34 +0100 Subject: [PATCH 02/39] remove unneeded import --- src/libs/actions/Report.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 263312baa1d7..49804bdfb5b2 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -27,7 +27,6 @@ import * as ReportActions from './ReportActions'; import Growl from '../Growl'; import * as Localize from '../Localize'; import PusherUtils from '../PusherUtils'; -import {read} from "../API"; let currentUserEmail; let currentUserAccountID; From 9777a88563305c4661723f10cf9f5bdb64fbbad2 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 15:29:44 +0100 Subject: [PATCH 03/39] updating OpenReport --- src/libs/actions/Report.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 49804bdfb5b2..a01caa6a190d 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1147,22 +1147,21 @@ function saveReportComment(reportID, comment) { * Open a report * * @param {String} reportID - * @returns {Promise} */ function openReport(reportID) { const sequenceNumber = reportMaxSequenceNumbers[reportID]; - API.read('OpenReport', + API.write('OpenReport', { reportID, + sequenceNumber, }, { optimisticData: [{ onyxMethod: 'merge', key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, value: { - history: [], - unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), lastVisitedTimestamp: Date.now(), + unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), }, }], successData: [], @@ -1171,17 +1170,15 @@ function openReport(reportID) { } /** - * Open a report + * Gets the first/oldest action for the chat/report * * @param {String} reportID - * @returns {Promise} */ function readOldestAction(reportID) { const sequenceNumber = reportMaxSequenceNumbers[reportID]; - API.read('ReadOldestAction', + API.write('ReadOldestAction', { reportID, - history, }, { optimisticData: [{ From ff8bb0f1f5565c3b9f83b843a22501f9a508f54a Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 15:32:08 +0100 Subject: [PATCH 04/39] duplicated OpenReport --- src/libs/actions/Report.js | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3ac2b4908278..c483785e8203 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1231,32 +1231,6 @@ function saveReportComment(reportID, comment) { Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`, comment); } -/** - * Open a report - * - * @param {String} reportID - */ -function openReport(reportID) { - const sequenceNumber = reportMaxSequenceNumbers[reportID]; - API.write('OpenReport', - { - reportID, - sequenceNumber, - }, - { - optimisticData: [{ - onyxMethod: 'merge', - key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - lastVisitedTimestamp: Date.now(), - unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), - }, - }], - successData: [], - failureData: [], - }); -} - /** * Gets the first/oldest action for the chat/report * From bdc16db10defeeeb42949f83dd5df11cd1aa8a8c Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 16:00:57 +0100 Subject: [PATCH 05/39] updating --- src/libs/actions/Report.js | 49 +++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index c483785e8203..8696016adf6c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1171,6 +1171,30 @@ function readNewestAction(reportID) { }); } +/** + * Gets the actions from the oldest unread action. + * + * @param {String} reportID + */ +function readOldestAction(reportID) { + Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, true); + API.read('ReadOldestAction', + { + reportID, + }, + { + optimisticData: [{ + onyxMethod: 'merge', + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + reportActionsToMerge: [], + }, + }], + successData: [], + failureData: [], + }); +} + /** * Sets the last read comment on a report * @@ -1231,31 +1255,6 @@ function saveReportComment(reportID, comment) { Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${reportID}`, comment); } -/** - * Gets the first/oldest action for the chat/report - * - * @param {String} reportID - */ -function readOldestAction(reportID) { - const sequenceNumber = reportMaxSequenceNumbers[reportID]; - API.write('ReadOldestAction', - { - reportID, - }, - { - optimisticData: [{ - onyxMethod: 'merge', - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - value: { - unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), - lastVisitedTimestamp: Date.now(), - }, - }], - successData: [], - failureData: [], - }); -} - /** * Immediate indication whether the report has a draft comment. * From 926d388347f9c57138f0c7bb0215162736c10bc3 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 16:05:06 +0100 Subject: [PATCH 06/39] adding is loading --- src/libs/actions/Report.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 8696016adf6c..3b276af005b9 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1202,6 +1202,8 @@ function readOldestAction(reportID) { * @param {Number} sequenceNumber */ function markCommentAsUnread(reportID, sequenceNumber) { + + API.write('MarkCommentAsUnread', { reportID, @@ -1216,8 +1218,24 @@ function markCommentAsUnread(reportID, sequenceNumber) { unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), }, }], - successData: [], - failureData: [], + successData: [ + { + onyxMethod: 'merge', + key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: { + isLoading: false, + }, + }, + ], + failureData: [ + { + onyxMethod: 'merge', + key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: { + isLoading: false, + }, + }, + ], }); } From 1f6fbe46a16929e47cb915454f6e4e507d44aaa5 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 16:07:10 +0100 Subject: [PATCH 07/39] improving on is loading --- src/libs/actions/Report.js | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 3b276af005b9..b2d2b6c703d0 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1202,7 +1202,15 @@ function readOldestAction(reportID) { * @param {Number} sequenceNumber */ function markCommentAsUnread(reportID, sequenceNumber) { - + const isNotLoadingData = { + onyxMethod: 'merge', + key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: { + isLoading: false, + }, + }; + + Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, true); API.write('MarkCommentAsUnread', { @@ -1219,22 +1227,10 @@ function markCommentAsUnread(reportID, sequenceNumber) { }, }], successData: [ - { - onyxMethod: 'merge', - key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, - value: { - isLoading: false, - }, - }, + isNotLoadingData, ], failureData: [ - { - onyxMethod: 'merge', - key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, - value: { - isLoading: false, - }, - }, + isNotLoadingData, ], }); } From 0a0cf9a082fa1249969ebd622479aa8aef48e501 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 16:08:02 +0100 Subject: [PATCH 08/39] I don't think there is optimistic data in this case, it just loads --- src/libs/actions/Report.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index b2d2b6c703d0..d8d33a397d42 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1218,14 +1218,7 @@ function markCommentAsUnread(reportID, sequenceNumber) { sequenceNumber, }, { - optimisticData: [{ - onyxMethod: 'merge', - key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - lastVisitedTimestamp: Date.now(), - unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), - }, - }], + optimisticData: [], successData: [ isNotLoadingData, ], From 3fffea6f737146880a7a77dc699a373a7733e4e2 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 30 Jun 2022 16:10:08 +0100 Subject: [PATCH 09/39] I was editing the wrong method --- src/libs/actions/Report.js | 54 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d8d33a397d42..722bd3d9bb9a 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1177,31 +1177,6 @@ function readNewestAction(reportID) { * @param {String} reportID */ function readOldestAction(reportID) { - Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, true); - API.read('ReadOldestAction', - { - reportID, - }, - { - optimisticData: [{ - onyxMethod: 'merge', - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - value: { - reportActionsToMerge: [], - }, - }], - successData: [], - failureData: [], - }); -} - -/** - * Sets the last read comment on a report - * - * @param {Number} reportID - * @param {Number} sequenceNumber - */ -function markCommentAsUnread(reportID, sequenceNumber) { const isNotLoadingData = { onyxMethod: 'merge', key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, @@ -1212,10 +1187,9 @@ function markCommentAsUnread(reportID, sequenceNumber) { Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, true); - API.write('MarkCommentAsUnread', + API.write('ReadOldestAction', { reportID, - sequenceNumber, }, { optimisticData: [], @@ -1228,6 +1202,32 @@ function markCommentAsUnread(reportID, sequenceNumber) { }); } +/** + * Sets the last read comment on a report + * + * @param {Number} reportID + * @param {Number} sequenceNumber + */ +function markCommentAsUnread(reportID, sequenceNumber) { + API.write('MarkCommentAsUnread', + { + reportID, + sequenceNumber, + }, + { + optimisticData: [{ + onyxMethod: 'merge', + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + lastVisitedTimestamp: Date.now(), + unreadActionCount: getUnreadActionCountFromSequenceNumber(reportID, sequenceNumber), + }, + }], + successData: [], + failureData: [], + }); +} + /** * Toggles the pinned state of the report. * From 01269a38496e5adc2c546aa11800cf5e58393821 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Fri, 1 Jul 2022 15:34:27 +0100 Subject: [PATCH 10/39] remove offset, I'm not sure it is needed --- src/libs/actions/Report.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 722bd3d9bb9a..cdc724003650 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1151,11 +1151,9 @@ function openReport(reportID) { * @param {Number} reportID */ function readNewestAction(reportID) { - const sequenceNumber = reportMaxSequenceNumbers[reportID]; API.write('ReadNewestAction', { reportID, - sequenceNumber, }, { optimisticData: [{ From 55835a639dcd3b687b7524b67f6bdf235c13169b Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 12 Jul 2022 16:22:23 +0100 Subject: [PATCH 11/39] no message --- src/libs/actions/Report.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 1dde426e967b..ba5d853abb36 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1088,6 +1088,7 @@ function readNewestAction(reportID) { * @param {String} reportID */ function readOldestAction(reportID) { + const maxSequenceNumber = getMaxSequenceNumber(reportID); const isNotLoadingData = { onyxMethod: 'merge', key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, @@ -1101,6 +1102,7 @@ function readOldestAction(reportID) { API.write('ReadOldestAction', { reportID, + maxSequenceNumber, }, { optimisticData: [], From ef81dbb0ed47e52a40053344020fb25e6a4c9425 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 12 Jul 2022 16:43:08 +0100 Subject: [PATCH 12/39] export method --- src/libs/actions/Report.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index ba5d853abb36..59319db74eee 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1606,5 +1606,6 @@ export { setIsComposerFullSize, markCommentAsUnread, readNewestAction, + readOldestAction, openReport, }; From 7ba25f144c7db941d35650bf3cecc31369355d67 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 12 Jul 2022 16:43:41 +0100 Subject: [PATCH 13/39] replace fetchData --- src/pages/home/report/ReportActionsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 2348489c9a8b..8b22a2510701 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -275,7 +275,7 @@ class ReportActionsView extends React.Component { } fetchData() { - Report.fetchActions(this.props.reportID); + Report.readOldestAction(this.props.reportID); } /** From c6b0cccf927b6caba8eb66c5c25a1defbce06f8b Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 12 Jul 2022 17:01:34 +0100 Subject: [PATCH 14/39] loadMoreChats --- src/libs/actions/Report.js | 8 ++++---- src/pages/home/report/ReportActionsView.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 59319db74eee..d59c5a672d11 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1085,10 +1085,10 @@ function readNewestAction(reportID) { /** * Gets the actions from the oldest unread action. * - * @param {String} reportID + * @param {Number} reportID + * @param {Number} offset */ -function readOldestAction(reportID) { - const maxSequenceNumber = getMaxSequenceNumber(reportID); +function readOldestAction(reportID, offset=0) { const isNotLoadingData = { onyxMethod: 'merge', key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, @@ -1102,7 +1102,7 @@ function readOldestAction(reportID) { API.write('ReadOldestAction', { reportID, - maxSequenceNumber, + offset, }, { optimisticData: [], diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 8b22a2510701..25376a006583 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -300,7 +300,7 @@ class ReportActionsView extends React.Component { // Retrieve the next REPORT.ACTIONS.LIMIT sized page of comments, unless we're near the beginning, in which // case just get everything starting from 0. const offset = Math.max(minSequenceNumber - CONST.REPORT.ACTIONS.LIMIT, 0); - Report.fetchActionsWithLoadingState(this.props.reportID, offset); + Report.readOldestAction(this.props.reportID, offset); } scrollToBottomAndMarkReportAsRead() { From 4e01c35b434a80a8e6dcfa1b2b1e56a5baff1a77 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 12 Jul 2022 17:10:25 +0100 Subject: [PATCH 15/39] linter requests --- src/libs/actions/Report.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d59c5a672d11..be8e58aaddd4 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1088,8 +1088,8 @@ function readNewestAction(reportID) { * @param {Number} reportID * @param {Number} offset */ -function readOldestAction(reportID, offset=0) { - const isNotLoadingData = { +function readOldestAction(reportID, offset = 0) { + const hasFinishedLoadingData = { onyxMethod: 'merge', key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, value: { @@ -1107,10 +1107,10 @@ function readOldestAction(reportID, offset=0) { { optimisticData: [], successData: [ - isNotLoadingData, + hasFinishedLoadingData, ], failureData: [ - isNotLoadingData, + hasFinishedLoadingData, ], }); } From 4a3bcd38c07c0299af7f9a340fa94aa8628e6483 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 12 Jul 2022 17:19:57 +0100 Subject: [PATCH 16/39] on the timer part as well --- src/libs/actions/Report.js | 60 ++++++++++++++------------------------ 1 file changed, 22 insertions(+), 38 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index be8e58aaddd4..8ac9f225cbec 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -777,46 +777,30 @@ function fetchAllReports( Timing.end(CONST.TIMING.HOMEPAGE_REPORTS_LOADED); } - // Delay fetching report history as it significantly increases sign in to interactive time. - // Register the timer so we can clean it up if the user quickly logs out after logging in. If we don't - // cancel the timer we'll make unnecessary API requests from the sign in page. - Timers.register(setTimeout(() => { - // Filter reports to see which ones have actions we need to fetch so we can preload Onyx with new - // content and improve chat switching experience by only downloading content we don't have yet. - // This improves performance significantly when reconnecting by limiting API requests and unnecessary - // data processing by Onyx. - const reportIDsWithMissingActions = _.chain(returnedReports) - .map(report => report.reportID) - .filter(reportID => ReportActions.isReportMissingActions(reportID, lodashGet(allReports, [reportID, 'maxSequenceNumber']))) - .value(); - - // Once we have the reports that are missing actions we will find the intersection between the most - // recently accessed reports and reports missing actions. Then we'll fetch the history for a small - // set to avoid making too many network requests at once. - const reportIDsToFetchActions = _.chain(ReportUtils.sortReportsByLastVisited(allReports)) - .map(report => report.reportID) - .reverse() - .intersection(reportIDsWithMissingActions) - .slice(0, 10) - .value(); - - if (_.isEmpty(reportIDsToFetchActions)) { - Log.info('[Report] Local reportActions up to date. Not fetching additional actions.'); - return; - } + // Let's get all the oldest possible actions from the top 10 reports and update them enough for the user + // to have to scroll to see/load more actions + + // NOTE: At the moment I'm not doing the reportIDsWithMissingActions as I'm not sure if it's needed. + const reportIDsToFetchActions = _.chain(ReportUtils.sortReportsByLastVisited(allReports)) + .map(report => report.reportID) + .reverse() + .slice(0, 10) + .value(); + + if (_.isEmpty(reportIDsToFetchActions)) { + Log.info('[Report] Local reportActions up to date. Not fetching additional actions.'); + return; + } - Log.info('[Report] Fetching reportActions for reportIDs: ', false, { - reportIDs: reportIDsToFetchActions, - }); - _.each(reportIDsToFetchActions, (reportID) => { - const offset = ReportActions.dangerouslyGetReportActionsMaxSequenceNumber(reportID, false); - fetchActions(reportID, offset); - }); + Log.info('[Report] Fetching reportActions for reportIDs: ', false, { + reportIDs: reportIDsToFetchActions, + }); + + _.each(reportIDsToFetchActions, (reportID) => { + const offset = ReportActions.dangerouslyGetReportActionsMaxSequenceNumber(reportID, false); + readOldestAction(reportID, offset); + }); - // We are waiting a set amount of time to allow the UI to finish loading before bogging it down with - // more requests and operations. Startup delay is longer since there is a lot more work done to build - // up the UI when the app first initializes. - }, shouldDelayActionsFetch ? CONST.FETCH_ACTIONS_DELAY.STARTUP : CONST.FETCH_ACTIONS_DELAY.RECONNECT)); }); } From 38e73a3545a85fd4424576b2fc885136b1448fb6 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 13 Jul 2022 15:46:10 +0100 Subject: [PATCH 17/39] removing the old timer section as it should no longer be needed --- src/libs/actions/Report.js | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 8ac9f225cbec..504ffdf4130d 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -776,31 +776,6 @@ function fetchAllReports( if (shouldRecordHomePageTiming) { Timing.end(CONST.TIMING.HOMEPAGE_REPORTS_LOADED); } - - // Let's get all the oldest possible actions from the top 10 reports and update them enough for the user - // to have to scroll to see/load more actions - - // NOTE: At the moment I'm not doing the reportIDsWithMissingActions as I'm not sure if it's needed. - const reportIDsToFetchActions = _.chain(ReportUtils.sortReportsByLastVisited(allReports)) - .map(report => report.reportID) - .reverse() - .slice(0, 10) - .value(); - - if (_.isEmpty(reportIDsToFetchActions)) { - Log.info('[Report] Local reportActions up to date. Not fetching additional actions.'); - return; - } - - Log.info('[Report] Fetching reportActions for reportIDs: ', false, { - reportIDs: reportIDsToFetchActions, - }); - - _.each(reportIDsToFetchActions, (reportID) => { - const offset = ReportActions.dangerouslyGetReportActionsMaxSequenceNumber(reportID, false); - readOldestAction(reportID, offset); - }); - }); } From ff7cd6b7778f29b4d8643e4e24d40baa5ddd851d Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 13 Jul 2022 15:47:18 +0100 Subject: [PATCH 18/39] also removing the timers import --- src/libs/actions/Report.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 504ffdf4130d..7adc4b885a16 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -21,7 +21,6 @@ import CONST from '../../CONST'; import Log from '../Log'; import * as LoginUtils from '../LoginUtils'; import * as ReportUtils from '../ReportUtils'; -import Timers from '../Timers'; import * as ReportActions from './ReportActions'; import Growl from '../Growl'; import * as Localize from '../Localize'; From 0d66a1f8f2f301c8163d70ed4833dda503ce48ab Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 13 Jul 2022 16:27:37 +0100 Subject: [PATCH 19/39] renaming offset to oldestActionSequenceNumber --- src/libs/actions/Report.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 7adc4b885a16..72883bf980aa 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1046,29 +1046,31 @@ function readNewestAction(reportID) { * @param {Number} reportID * @param {Number} offset */ -function readOldestAction(reportID, offset = 0) { - const hasFinishedLoadingData = { - onyxMethod: 'merge', +function readOldestAction(reportID, oldestActionSequenceNumber = 0) { + const finishedLoadingData = { + onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, value: { isLoading: false, }, }; - Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, true); - API.write('ReadOldestAction', { reportID, - offset, + reportActionsOffset: oldestActionSequenceNumber, }, { - optimisticData: [], + optimisticData: [{ + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: {isLoading: true}, + }], successData: [ - hasFinishedLoadingData, + finishedLoadingData, ], failureData: [ - hasFinishedLoadingData, + finishedLoadingData, ], }); } From dd5d4b642266ff00e605f3992655cb1198f9fabb Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 13 Jul 2022 16:27:53 +0100 Subject: [PATCH 20/39] was the same but forgot about it --- src/pages/home/report/ReportActionsView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 25376a006583..268db615b09a 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -299,8 +299,8 @@ class ReportActionsView extends React.Component { // Retrieve the next REPORT.ACTIONS.LIMIT sized page of comments, unless we're near the beginning, in which // case just get everything starting from 0. - const offset = Math.max(minSequenceNumber - CONST.REPORT.ACTIONS.LIMIT, 0); - Report.readOldestAction(this.props.reportID, offset); + const oldestActionSequenceNumber = Math.max(minSequenceNumber - CONST.REPORT.ACTIONS.LIMIT, 0); + Report.readOldestAction(this.props.reportID, oldestActionSequenceNumber); } scrollToBottomAndMarkReportAsRead() { From 8b17188c631070839c7805cc19277007fa9d8cb5 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 13 Jul 2022 16:56:06 +0100 Subject: [PATCH 21/39] reverting --- src/pages/home/report/ReportActionsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 268db615b09a..6adc9da65181 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -275,7 +275,7 @@ class ReportActionsView extends React.Component { } fetchData() { - Report.readOldestAction(this.props.reportID); + Report.fetchActions(this.props.reportID); } /** From 3f06e7a95092790366108f93c7b16f27a4607f8d Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 14 Jul 2022 22:44:29 +0100 Subject: [PATCH 22/39] collections is loading report actions --- src/ONYXKEYS.js | 1 + src/libs/actions/Report.js | 62 +++++++++++++++++++------------------- 2 files changed, 32 insertions(+), 31 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 1f47b414ee23..380bfe37f010 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -106,6 +106,7 @@ export default { POLICY: 'policy_', REPORTS_WITH_DRAFT: 'reportWithDraft_', REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_', + IS_LOADING_REPORT_ACTIONS: 'isLoadingReportActions_' }, // Indicates which locale should be used diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 72883bf980aa..ddb3c6d84520 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1016,46 +1016,22 @@ function openReport(reportID) { }); } -/** - * Marks the new report actions as read - * - * @param {Number} reportID - */ -function readNewestAction(reportID) { - const sequenceNumber = getMaxSequenceNumber(reportID); - API.write('ReadNewestAction', - { - reportID, - }, - { - optimisticData: [{ - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, - value: { - lastReadSequenceNumber: sequenceNumber, - lastVisitedTimestamp: Date.now(), - unreadActionCount: 0, - }, - }], - }); -} - /** * Gets the actions from the oldest unread action. * * @param {Number} reportID * @param {Number} offset */ -function readOldestAction(reportID, oldestActionSequenceNumber = 0) { - const finishedLoadingData = { +function readOldestAction(reportID, oldestActionSequenceNumber) { + const completionData = { onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, + key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, value: { isLoading: false, }, }; - API.write('ReadOldestAction', + API.read('ReadOldestAction', { reportID, reportActionsOffset: oldestActionSequenceNumber, @@ -1063,18 +1039,42 @@ function readOldestAction(reportID, oldestActionSequenceNumber = 0) { { optimisticData: [{ onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.IS_LOADING_REPORT_ACTIONS}${reportID}`, + key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, value: {isLoading: true}, }], successData: [ - finishedLoadingData, + completionData, ], failureData: [ - finishedLoadingData, + completionData, ], }); } +/** + * Marks the new report actions as read + * + * @param {Number} reportID + */ +function readNewestAction(reportID) { + const sequenceNumber = getMaxSequenceNumber(reportID); + API.write('ReadNewestAction', + { + reportID, + }, + { + optimisticData: [{ + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`, + value: { + lastReadSequenceNumber: sequenceNumber, + lastVisitedTimestamp: Date.now(), + unreadActionCount: 0, + }, + }], + }); +} + /** * Sets the last read comment on a report * From 2740fdec8f046bf86d52a3f27647363bb47b2d8f Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Fri, 15 Jul 2022 12:56:12 +0100 Subject: [PATCH 23/39] fixing linter; part of it is removing an argument that is no longer used in fetchAllReports --- src/ONYXKEYS.js | 2 +- src/libs/actions/App.js | 2 +- src/libs/actions/Policy.js | 2 +- src/libs/actions/Report.js | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 380bfe37f010..a2608c846681 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -106,7 +106,7 @@ export default { POLICY: 'policy_', REPORTS_WITH_DRAFT: 'reportWithDraft_', REPORT_IS_COMPOSER_FULL_SIZE: 'reportIsComposerFullSize_', - IS_LOADING_REPORT_ACTIONS: 'isLoadingReportActions_' + IS_LOADING_REPORT_ACTIONS: 'isLoadingReportActions_', }, // Indicates which locale should be used diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index 4196ea1c3c19..2c9ce753ba65 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -106,7 +106,7 @@ function getAppData(shouldSyncPolicyList = true) { // We should update the syncing indicator when personal details and reports are both done fetching. return Promise.all([ PersonalDetails.fetchPersonalDetails(), - Report.fetchAllReports(true, true), + Report.fetchAllReports(true), ]); } diff --git a/src/libs/actions/Policy.js b/src/libs/actions/Policy.js index c4117360bd7e..fc9b6088228d 100644 --- a/src/libs/actions/Policy.js +++ b/src/libs/actions/Policy.js @@ -190,7 +190,7 @@ function deletePolicy(policyID) { // Removing the workspace data from Onyx as well return Onyx.set(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`, null); }) - .then(() => Report.fetchAllReports(false, true)) + .then(() => Report.fetchAllReports(false)) .then(() => { Navigation.goBack(); return Promise.resolve(); diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index ddb3c6d84520..f7cfda64e356 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -735,12 +735,10 @@ function fetchActionsWithLoadingState(reportID, offset) { * Get all of our reports * * @param {Boolean} shouldRecordHomePageTiming whether or not performance timing should be measured - * @param {Boolean} shouldDelayActionsFetch when the app loads we want to delay the fetching of additional actions * @returns {Promise} */ function fetchAllReports( shouldRecordHomePageTiming = false, - shouldDelayActionsFetch = false, ) { Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, true); return DeprecatedAPI.Get({ From dc1cf4cd4b9bd3d5c5c3e62e5b3f4b59784bcc6f Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Fri, 15 Jul 2022 13:06:36 +0100 Subject: [PATCH 24/39] missed one --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index f7cfda64e356..903efc0ef792 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1018,7 +1018,7 @@ function openReport(reportID) { * Gets the actions from the oldest unread action. * * @param {Number} reportID - * @param {Number} offset + * @param {Number} oldestActionSequenceNumber */ function readOldestAction(reportID, oldestActionSequenceNumber) { const completionData = { From 65bf5172cfb6c79db9f3549b3c5a34bbe8eb158b Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 19 Jul 2022 15:55:12 +0100 Subject: [PATCH 25/39] this no longes seems to be used --- src/libs/actions/Report.js | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 903efc0ef792..248e42491ef3 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -719,18 +719,6 @@ function fetchActions(reportID, offset) { }); } -/** - * Get the actions of a report - * - * @param {Number} reportID - * @param {Number} [offset] - */ -function fetchActionsWithLoadingState(reportID, offset) { - Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, true); - fetchActions(reportID, offset) - .finally(() => Onyx.set(ONYXKEYS.IS_LOADING_REPORT_ACTIONS, false)); -} - /** * Get all of our reports * @@ -1558,7 +1546,6 @@ export { navigateToConciergeChat, handleInaccessibleReport, setReportWithDraft, - fetchActionsWithLoadingState, createPolicyRoom, renameReport, setIsComposerFullSize, From 24d7b318212a34d15e38893debc27284b027c3af Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 19 Jul 2022 15:56:38 +0100 Subject: [PATCH 26/39] nothing uses offset on fetchActions anymore --- src/libs/actions/Report.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 248e42491ef3..4269772d6644 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -690,11 +690,10 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) { * Get the actions of a report * * @param {Number} reportID - * @param {Number} [offset] * @returns {Promise} */ -function fetchActions(reportID, offset) { - const reportActionsOffset = !_.isUndefined(offset) ? offset : -1; +function fetchActions(reportID) { + const reportActionsOffset = -1; if (!_.isNumber(reportActionsOffset)) { Log.alert('[Report] Offset provided is not a number', { From 5287bc7b2e67919665654c6836fc10e5b4ac7358 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Tue, 19 Jul 2022 16:40:08 +0100 Subject: [PATCH 27/39] this makes more sense --- src/libs/actions/Report.js | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index f534a95dfa6e..2796d78ad257 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1082,14 +1082,6 @@ function openReport(reportID) { * @param {Number} oldestActionSequenceNumber */ function readOldestAction(reportID, oldestActionSequenceNumber) { - const completionData = { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, - value: { - isLoading: false, - }, - }; - API.read('ReadOldestAction', { reportID, @@ -1102,11 +1094,27 @@ function readOldestAction(reportID, oldestActionSequenceNumber) { value: {isLoading: true}, }], successData: [ - completionData, - ], - failureData: [ - completionData, + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: { + isLoading: false, + error: '', + }, + }, + { + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, + value: { + error: '', + }, + } ], + failureData: [{ + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: {isLoading: false}, + }], }); } From 9f3fab1e7db588887ebdb473d0cbeb40f387e8c8 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 16:06:07 +0100 Subject: [PATCH 28/39] removing errors --- src/libs/actions/Report.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 2796d78ad257..d29a87a3d409 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1099,15 +1099,12 @@ function readOldestAction(reportID, oldestActionSequenceNumber) { key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, value: { isLoading: false, - error: '', }, }, { onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - value: { - error: '', - }, + value: {}, } ], failureData: [{ From d8292724c29cf26cec9f584437f6bf263e2f47e4 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 16:06:22 +0100 Subject: [PATCH 29/39] this was done by mistake, reverting. --- src/libs/actions/Report.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index d29a87a3d409..32a358435933 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1138,6 +1138,7 @@ function readNewestAction(reportID) { API.write('ReadNewestAction', { reportID, + sequenceNumber, }, { optimisticData: [{ From 0eece64f96cc8e124bfd0c2284d63cab7e90bc98 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 16:42:14 +0100 Subject: [PATCH 30/39] no need for value --- src/libs/actions/Report.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 32a358435933..2e0c6fecdd62 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1104,7 +1104,6 @@ function readOldestAction(reportID, oldestActionSequenceNumber) { { onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - value: {}, } ], failureData: [{ From 92ddb4a0f30b673c9356f5b07043f57c618512f4 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 16:42:34 +0100 Subject: [PATCH 31/39] changing the ONYX key for the loading --- src/pages/home/report/ReportActionsView.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 9b6b88abcc92..13996ffff587 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -458,7 +458,7 @@ export default compose( key: ONYXKEYS.IS_LOADING_REPORT_DATA, }, isLoadingReportActions: { - key: ONYXKEYS.IS_LOADING_REPORT_ACTIONS, + key: ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS, initWithStoredValues: false, }, }), From 17769b9be5681d8490b51b528a622a44578d1727 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 22:36:36 +0100 Subject: [PATCH 32/39] offset is always a number --- src/libs/actions/Report.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 2e0c6fecdd62..cceb8b9c452c 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -695,14 +695,6 @@ function fetchOrCreateChatReport(participants, shouldNavigate = true) { function fetchActions(reportID) { const reportActionsOffset = -1; - if (!_.isNumber(reportActionsOffset)) { - Log.alert('[Report] Offset provided is not a number', { - offset, - reportActionsOffset, - }); - return; - } - return DeprecatedAPI.Report_GetHistory({ reportID, reportActionsOffset, From a3592e27150b1d31bcbd0d056590cde7f6a7d671 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 22:41:09 +0100 Subject: [PATCH 33/39] correcting the onyx key --- src/ONYXKEYS.js | 3 --- src/pages/home/report/ReportActionsView.js | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/ONYXKEYS.js b/src/ONYXKEYS.js index 10b0197c1cdb..e3a88f8371f7 100755 --- a/src/ONYXKEYS.js +++ b/src/ONYXKEYS.js @@ -160,9 +160,6 @@ export default { // The number of minutes a user has to wait for a call. INBOX_CALL_USER_WAIT_TIME: 'inboxCallUserWaitTime', - // Are report actions loading? - IS_LOADING_REPORT_ACTIONS: 'isLoadingReportActions', - // Is report data loading? IS_LOADING_REPORT_DATA: 'isLoadingReportData', diff --git a/src/pages/home/report/ReportActionsView.js b/src/pages/home/report/ReportActionsView.js index 13996ffff587..c09c2e0ec431 100755 --- a/src/pages/home/report/ReportActionsView.js +++ b/src/pages/home/report/ReportActionsView.js @@ -458,7 +458,7 @@ export default compose( key: ONYXKEYS.IS_LOADING_REPORT_DATA, }, isLoadingReportActions: { - key: ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS, + key: ({reportID}) => `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, initWithStoredValues: false, }, }), From 048751deb8c3e1741662440c95ec1eddce9441fc Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 22:41:17 +0100 Subject: [PATCH 34/39] style --- src/libs/actions/Report.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index cceb8b9c452c..72a284d65bc5 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1096,7 +1096,7 @@ function readOldestAction(reportID, oldestActionSequenceNumber) { { onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - } + }, ], failureData: [{ onyxMethod: CONST.ONYX.METHOD.MERGE, From 700792aeba3cee84b9b3ec98c161488340919c07 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 23:03:43 +0100 Subject: [PATCH 35/39] commit new package --- package-lock.json | 489 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 441 insertions(+), 48 deletions(-) diff --git a/package-lock.json b/package-lock.json index ba77a32189bb..ae24b801affc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3954,6 +3954,15 @@ } } }, + "@jest/schemas": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/schemas/-/schemas-28.1.3.tgz", + "integrity": "sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg==", + "dev": true, + "requires": { + "@sinclair/typebox": "^0.24.1" + } + }, "@jest/test-sequencer": { "version": "26.6.0", "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.0.tgz", @@ -6836,6 +6845,12 @@ "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==" }, + "@sinclair/typebox": { + "version": "0.24.20", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.20.tgz", + "integrity": "sha512-kVaO5aEFZb33nPMTZBxiPEkY+slxiPtqC7QX8f9B3eGOMBvEfuMfxp9DSTTCsRJPumPKjrge4yagyssO4q6qzQ==", + "dev": true + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -21683,9 +21698,9 @@ "dev": true }, "@types/babel__core": { - "version": "7.1.10", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.10.tgz", - "integrity": "sha512-x8OM8XzITIMyiwl5Vmo2B1cR1S1Ipkyv4mdlbJjMa1lmuKvKY9FrBbEANIaMlnWn5Rf7uO+rC/VgYabNkE17Hw==", + "version": "7.1.19", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.19.tgz", + "integrity": "sha512-WEOTgRsbYkvA/KCsDwVEGkd7WAr1e3g31VHQ8zy5gul/V1qKullU/BU5I68X5v7V3GnB9eotmom4v5a5gjxorw==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -21696,18 +21711,18 @@ } }, "@types/babel__generator": { - "version": "7.6.2", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", - "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz", + "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==", "dev": true, "requires": { "@babel/types": "^7.0.0" } }, "@types/babel__template": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.3.tgz", - "integrity": "sha512-uCoznIPDmnickEi6D0v11SBpW0OuVqHJCa7syXqQHy5uktSCreIlt0iglsCnmvz8yCb38hGcWeseA8cWJSwv5Q==", + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz", + "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==", "dev": true, "requires": { "@babel/parser": "^7.1.0", @@ -23944,7 +23959,7 @@ "ascii-table": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", - "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=" + "integrity": "sha512-xpkr6sCDIYTPqzvjG8M3ncw1YOTaloWZOyrUmicoEifBEKzQzt+ooUpRpQ/AbOoJfO/p2ZKiyp79qHThzJDulQ==" }, "asn1": { "version": "0.2.4", @@ -24219,51 +24234,317 @@ } }, "babel-jest": { - "version": "26.6.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.0.tgz", - "integrity": "sha512-JI66yILI7stzjHccAoQtRKcUwJrJb4oMIxLTirL3GdAjGpaUBQSjZDFi9LsPkN4gftsS4R2AThAJwOjJxadwbg==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.3.tgz", + "integrity": "sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q==", "dev": true, "requires": { - "@jest/transform": "^26.6.0", - "@jest/types": "^26.6.0", - "@types/babel__core": "^7.1.7", - "babel-plugin-istanbul": "^6.0.0", - "babel-preset-jest": "^26.5.0", + "@jest/transform": "^28.1.3", + "@types/babel__core": "^7.1.14", + "babel-plugin-istanbul": "^6.1.1", + "babel-preset-jest": "^28.1.3", "chalk": "^4.0.0", - "graceful-fs": "^4.2.4", + "graceful-fs": "^4.2.9", "slash": "^3.0.0" }, "dependencies": { + "@babel/parser": { + "version": "7.18.9", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.18.9.tgz", + "integrity": "sha512-9uJveS9eY9DJ0t64YbIBZICtJy8a5QrDEVdiLCG97fVLpDTpGX7t8mMSb6OWw6Lrnjqj4O8zwjELX3dhoMgiBg==", + "dev": true + }, + "@jest/transform": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-28.1.3.tgz", + "integrity": "sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA==", + "dev": true, + "requires": { + "@babel/core": "^7.11.6", + "@jest/types": "^28.1.3", + "@jridgewell/trace-mapping": "^0.3.13", + "babel-plugin-istanbul": "^6.1.1", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.9", + "jest-haste-map": "^28.1.3", + "jest-regex-util": "^28.0.2", + "jest-util": "^28.1.3", + "micromatch": "^4.0.4", + "pirates": "^4.0.4", + "slash": "^3.0.0", + "write-file-atomic": "^4.0.1" + } + }, "@jest/types": { - "version": "26.6.0", - "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.0.tgz", - "integrity": "sha512-8pDeq/JVyAYw7jBGU83v8RMYAkdrRxLG3BGnAJuqaQAUd6GWBmND2uyl+awI88+hit48suLoLjNFtR+ZXxWaYg==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-28.1.3.tgz", + "integrity": "sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ==", "dev": true, "requires": { + "@jest/schemas": "^28.1.3", "@types/istanbul-lib-coverage": "^2.0.0", "@types/istanbul-reports": "^3.0.0", "@types/node": "*", - "@types/yargs": "^15.0.0", + "@types/yargs": "^17.0.8", "chalk": "^4.0.0" } }, "@types/istanbul-reports": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", - "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz", + "integrity": "sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw==", "dev": true, "requires": { "@types/istanbul-lib-report": "*" } }, - "chalk": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "@types/yargs": { + "version": "17.0.10", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.10.tgz", + "integrity": "sha512-gmEaFwpj/7f/ROdtIlci1R1VYU1J4j95m8T+Tj3iBgiBFKg1foE/PSl93bBd5T9LDXNPo8UlNN6W0qwD8O5OaA==", "dev": true, "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "@types/yargs-parser": "*" + } + }, + "anymatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", + "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + } + }, + "babel-plugin-istanbul": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz", + "integrity": "sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^5.0.4", + "test-exclude": "^6.0.0" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "ci-info": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-3.3.2.tgz", + "integrity": "sha512-xmDt/QIAdeZ9+nfdPsaBCpMvHNLFiLdjj59qjqn+6iPe6YmHGQ35sBnQ8uslRBXFmXkiZQOJRjvQeoGppoTjjg==", + "dev": true + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "fsevents": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", + "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "dev": true, + "optional": true + }, + "graceful-fs": { + "version": "4.2.10", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", + "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "istanbul-lib-coverage": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz", + "integrity": "sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.0.tgz", + "integrity": "sha512-6Lthe1hqXHBNsqvgDzGO6l03XNeu3CrG4RqQ1KM9+l5+jNGpEJfIELx1NS3SEHmJQA8np/u+E4EPRKRiu6m19A==", + "dev": true, + "requires": { + "@babel/core": "^7.12.3", + "@babel/parser": "^7.14.7", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.2.0", + "semver": "^6.3.0" + } + }, + "jest-haste-map": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-28.1.3.tgz", + "integrity": "sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA==", + "dev": true, + "requires": { + "@jest/types": "^28.1.3", + "@types/graceful-fs": "^4.1.3", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "fsevents": "^2.3.2", + "graceful-fs": "^4.2.9", + "jest-regex-util": "^28.0.2", + "jest-util": "^28.1.3", + "jest-worker": "^28.1.3", + "micromatch": "^4.0.4", + "walker": "^1.0.8" + } + }, + "jest-regex-util": { + "version": "28.0.2", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-28.0.2.tgz", + "integrity": "sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw==", + "dev": true + }, + "jest-util": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-28.1.3.tgz", + "integrity": "sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ==", + "dev": true, + "requires": { + "@jest/types": "^28.1.3", + "@types/node": "*", + "chalk": "^4.0.0", + "ci-info": "^3.2.0", + "graceful-fs": "^4.2.9", + "picomatch": "^2.2.3" + }, + "dependencies": { + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + } + } + }, + "jest-worker": { + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-28.1.3.tgz", + "integrity": "sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g==", + "dev": true, + "requires": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^8.0.0" + } + }, + "makeerror": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz", + "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==", + "dev": true, + "requires": { + "tmpl": "1.0.5" + } + }, + "micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, + "requires": { + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "dependencies": { + "picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true + } + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "pirates": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", + "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, + "signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true + }, + "supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "tmpl": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz", + "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "walker": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz", + "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==", + "dev": true, + "requires": { + "makeerror": "1.0.12" + } + }, + "write-file-atomic": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-4.0.1.tgz", + "integrity": "sha512-nSKUxgAbyioruk6hU87QzVbY279oYT6uiwgDoujth2ju4mJ+TZau7SQBhtbTmUyuNYTuXnSyRn66FV0+eCgcrQ==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.7" } } } @@ -24370,14 +24651,14 @@ } }, "babel-plugin-jest-hoist": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.5.0.tgz", - "integrity": "sha512-ck17uZFD3CDfuwCLATWZxkkuGGFhMij8quP8CNhwj8ek1mqFgbFzRJ30xwC04LLscj/aKsVFfRST+b5PT7rSuw==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.3.tgz", + "integrity": "sha512-Ys3tUKAmfnkRUpPdpa98eYrAR0nV+sSFUZZEGuQ2EbFd1y4SOLtD5QDNHAq+bb9a+bbXvYQC4b+ID/THIMcU6Q==", "dev": true, "requires": { "@babel/template": "^7.3.3", "@babel/types": "^7.3.3", - "@types/babel__core": "^7.0.0", + "@types/babel__core": "^7.1.14", "@types/babel__traverse": "^7.0.6" } }, @@ -24855,9 +25136,9 @@ "integrity": "sha1-uYA2DAZzhOJLNXpYjYB9PINSd4A=" }, "babel-preset-current-node-syntax": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-0.1.4.tgz", - "integrity": "sha512-5/INNCYhUGqw7VbVjT/hb3ucjgkVHKXY7lX3ZjlN4gm565VyFmJUrJ/h+h16ECVB38R/9SF6aACydpKMLZ/c9w==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", "dev": true, "requires": { "@babel/plugin-syntax-async-generators": "^7.8.4", @@ -24870,7 +25151,8 @@ "@babel/plugin-syntax-numeric-separator": "^7.8.3", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" } }, "babel-preset-fbjs": { @@ -24908,13 +25190,13 @@ } }, "babel-preset-jest": { - "version": "26.5.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.5.0.tgz", - "integrity": "sha512-F2vTluljhqkiGSJGBg/jOruA8vIIIL11YrxRcO7nviNTMbbofPSHwnm8mgP7d/wS7wRSexRoI6X1A6T74d4LQA==", + "version": "28.1.3", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-28.1.3.tgz", + "integrity": "sha512-L+fupJvlWAHbQfn74coNX3zf60LXMJsezNvvx8eIh7iOR1luJ1poxYgQk1F8PYtNq/6QODDHCqsSnTFSWC491A==", "dev": true, "requires": { - "babel-plugin-jest-hoist": "^26.5.0", - "babel-preset-current-node-syntax": "^0.1.3" + "babel-plugin-jest-hoist": "^28.1.3", + "babel-preset-current-node-syntax": "^1.0.0" } }, "babel-runtime": { @@ -34733,6 +35015,58 @@ "pretty-format": "^26.6.0" }, "dependencies": { + "@jest/transform": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", + "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^26.6.2", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-util": "^26.6.2", + "micromatch": "^4.0.2", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + }, + "jest-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "dev": true, + "requires": { + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "is-ci": "^2.0.0", + "micromatch": "^4.0.2" + } + } + } + }, "@jest/types": { "version": "26.6.0", "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.0.tgz", @@ -34755,6 +35089,59 @@ "@types/istanbul-lib-report": "*" } }, + "babel-jest": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", + "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "dev": true, + "requires": { + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/babel__core": "^7.1.7", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^26.6.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + }, + "dependencies": { + "@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + } + } + } + }, + "babel-plugin-jest-hoist": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", + "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "dev": true, + "requires": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + } + }, + "babel-preset-jest": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", + "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "dev": true, + "requires": { + "babel-plugin-jest-hoist": "^26.6.2", + "babel-preset-current-node-syntax": "^1.0.0" + } + }, "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", @@ -34857,6 +35244,12 @@ "react-is": "^16.12.0" } }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -43503,9 +43896,9 @@ } }, "react-native-onyx": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.8.tgz", - "integrity": "sha512-PcYb/EessNvcuQtRHhoax1P4xzzUdywCQTOl2OE9AGPGym/ob7Tj/IgP4XhyTj4K91lV004hNvTQdv8WpSd0VA==", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-1.0.10.tgz", + "integrity": "sha512-cWKb/LEDtVCeVoYP8OIbb2Xz4aYjqtRaDxHrWmSB5TtSeEQa0JztJzJt9EnTQ0+Xbc2VE0eHBBvBbWUrPQVsVg==", "requires": { "ascii-table": "0.0.9", "lodash": "^4.17.21", From 92c619e05d8b9a3af0e94b02d59feadabdfee17b Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Wed, 20 Jul 2022 23:41:02 +0100 Subject: [PATCH 36/39] remove object for is loading, remove successData for actions --- src/libs/actions/Report.js | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index fcd281779873..52b4f3187e0d 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1111,25 +1111,17 @@ function readOldestAction(reportID, oldestActionSequenceNumber) { optimisticData: [{ onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, - value: {isLoading: true}, + value: true, + }], + successData: [{ + onyxMethod: CONST.ONYX.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, + value: false, }], - successData: [ - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, - value: { - isLoading: false, - }, - }, - { - onyxMethod: CONST.ONYX.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`, - }, - ], failureData: [{ onyxMethod: CONST.ONYX.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.IS_LOADING_REPORT_ACTIONS}${reportID}`, - value: {isLoading: false}, + value: false, }], }); } From b9e84f692fedc007054986b1145bd53c2ef2a82c Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 21 Jul 2022 15:54:16 +0100 Subject: [PATCH 37/39] reseting the file --- package-lock.json | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index ae24b801affc..ffdcfecd2d8f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.85-5", + "version": "1.1.85-6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -23959,7 +23959,7 @@ "ascii-table": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/ascii-table/-/ascii-table-0.0.9.tgz", - "integrity": "sha512-xpkr6sCDIYTPqzvjG8M3ncw1YOTaloWZOyrUmicoEifBEKzQzt+ooUpRpQ/AbOoJfO/p2ZKiyp79qHThzJDulQ==" + "integrity": "sha1-BqZgTWpV1L9BqaR9mHLXp42jHnM=" }, "asn1": { "version": "0.2.4", @@ -32696,7 +32696,7 @@ "good-listener": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz", - "integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=", + "integrity": "sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==", "requires": { "delegate": "^3.1.2" } @@ -33084,7 +33084,7 @@ "history": { "version": "4.5.1", "resolved": "https://registry.npmjs.org/history/-/history-4.5.1.tgz", - "integrity": "sha1-RJNaUQIeO45n66wmejVnVzKrpWk=", + "integrity": "sha512-gfHeJeYeMzFtos61gdA1AloO0hGXPF2Yum+2FRdJvlylYQOz51OnT1zuwg9UYst1BRrONhcAh3Nmsg9iblgl6g==", "requires": { "invariant": "^2.2.1", "loose-envify": "^1.2.0", @@ -33096,7 +33096,7 @@ "warning": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz", - "integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=", + "integrity": "sha512-jMBt6pUrKn5I+OGgtQ4YZLdhIeJmObddh6CsibPxyQ5yPZm1XExSyzC1LCNX7BzhxWgiHmizBWJTHJIjMjTQYQ==", "requires": { "loose-envify": "^1.0.0" } @@ -45648,7 +45648,7 @@ "select": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz", - "integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0=" + "integrity": "sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==" }, "select-hose": { "version": "2.0.0", @@ -49079,7 +49079,7 @@ "value-equal": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/value-equal/-/value-equal-0.2.1.tgz", - "integrity": "sha1-wiCjBDYfzmmU277ao8fhobiVhx0=" + "integrity": "sha512-yRL36Xb2K/HmFT5Fe3M86S7mu4+a12/3l7uytUh6eNPPjP77ldPBvsAvmnWff39sXn55naRMZN8LZWRO8PWaeQ==" }, "vary": { "version": "1.1.2", From ec6c14159e1bd153c0e301eeb6276dfb3bf27688 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 21 Jul 2022 15:55:23 +0100 Subject: [PATCH 38/39] version is wrong? --- package-lock.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-lock.json b/package-lock.json index ffdcfecd2d8f..024dbce3e1ca 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "new.expensify", - "version": "1.1.85-6", + "version": "1.1.85-5", "lockfileVersion": 1, "requires": true, "dependencies": { From a016a6158f3461f73f46b27615acaf6a942875b8 Mon Sep 17 00:00:00 2001 From: Andre Fonseca Date: Thu, 21 Jul 2022 16:03:15 +0100 Subject: [PATCH 39/39] Updated the description a bit --- src/libs/actions/Report.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Report.js b/src/libs/actions/Report.js index 52b4f3187e0d..e101ef0c2b74 100644 --- a/src/libs/actions/Report.js +++ b/src/libs/actions/Report.js @@ -1096,7 +1096,8 @@ function openReport(reportID) { } /** - * Gets the actions from the oldest unread action. + * Gets the older actions that have not been read yet. + * Normally happens when you scroll up on a chat, and the actions have not been read yet. * * @param {Number} reportID * @param {Number} oldestActionSequenceNumber