Skip to content

Commit

Permalink
Merge pull request #23748 from Expensify/yuwen-removePolicyIDs
Browse files Browse the repository at this point in the history
Replace policyIDList with policyIDToLastModified map in Reconnect App call
  • Loading branch information
luacmartins committed Aug 2, 2023
2 parents 5a7791f + f4c236c commit bee8914
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/libs/actions/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,6 @@ function confirmReadyToOpenApp() {
resolveIsReadyPromise();
}

/**
* @param {Array} policies
* @return {Array<String>} array of policy ids
*/
function getNonOptimisticPolicyIDs(policies) {
return _.chain(policies)
.reject((policy) => lodashGet(policy, 'pendingAction', null) === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD)
.pluck('id')
.compact()
.value();
}

/**
* @param {Array} policies
* @return {Object} map of policy id to lastUpdated
Expand Down Expand Up @@ -148,7 +136,7 @@ function openApp(isReconnecting = false) {
//
// - Look through the local report actions and reports to find the most recently modified report action or report.
// - We send this to the server so that it can compute which new chats the user needs to see and return only those as an optimization.
const params = {policyIDList: getNonOptimisticPolicyIDs(policies), policyIDToLastModified: JSON.stringify(getNonOptimisticPolicyIDToLastModifiedMap(policies))};
const params = {policyIDToLastModified: JSON.stringify(getNonOptimisticPolicyIDToLastModifiedMap(policies))};
if (isReconnecting) {
Timing.start(CONST.TIMING.CALCULATE_MOST_RECENT_LAST_MODIFIED_ACTION);
params.mostRecentReportActionLastModified = ReportActionsUtils.getMostRecentReportActionLastModified();
Expand Down

0 comments on commit bee8914

Please sign in to comment.