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

Replace policyIDList with policyIDToLastModified map in Reconnect App call #23748

Merged
merged 1 commit into from
Aug 2, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading