Skip to content

[HR Import] Handle Merge daily sync limit error with popup#94889

Merged
cristipaval merged 17 commits into
Expensify:mainfrom
software-mansion-labs:merge-hr/daily-sync-limit
Jul 10, 2026
Merged

[HR Import] Handle Merge daily sync limit error with popup#94889
cristipaval merged 17 commits into
Expensify:mainfrom
software-mansion-labs:merge-hr/daily-sync-limit

Conversation

@mhawryluk

@mhawryluk mhawryluk commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

Displays a confirm modal informing the user they cannot schedule a manual Merge HR synchronization due to reaching a daily limit and doesn't schedule the backend call in that case.

Fixed Issues

$ #91426
PROPOSAL: N/A

Tests

  1. Open a workspace with a Merge HR provider connected.
  2. Click three dot menu > "Sync now" a couple of times.
  3. Verify that when the daily limit is reached (2 syncs), an info modal is shown and can be dismissed.
  4. Verify that no backend call is scheduled when the limit is reached.
  5. Log in to a different account that is also an admin of that workspace.
  6. Verify the limit is enforced per workspace, so when one admin maxes out the limit, the other admins see the modal immediately when trying to "Sync now" after that.
  7. Verify the same mechanism works in the Workspace > Members page (More > Sync with <provider>)

Offline tests

  • When offline the "Sync now" button is disabled (already on main), so nothing should happen when clicked on it then.
  • In the Members page the "More" > "Sync with provider" button shows an info modal that an internet connection is required (already on main) when clicked while offline, there should be no change here.

QA Steps

Same as tests.

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-02.at.11.41.54.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-06-30.o.10.04.11.mov
Nagranie.z.ekranu.2026-07-2.o.11.36.22.mov

@melvin-bot

melvin-bot Bot commented Jun 29, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@mhawryluk mhawryluk changed the title [HR Import] Handle Merge daily sync limit error with popup [NoQA[HR Import] Handle Merge daily sync limit error with popup Jun 29, 2026
@mhawryluk mhawryluk changed the title [NoQA[HR Import] Handle Merge daily sync limit error with popup [NoQA] [HR Import] Handle Merge daily sync limit error with popup Jun 29, 2026

@jmusial jmusial left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Overall looks good, couple comments.

Comment thread src/languages/en.ts
Comment thread src/types/onyx/Policy.ts Outdated
Comment thread src/pages/workspace/hr/HRProviderCard.tsx Outdated
@OSBotify

OSBotify commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index c45021fe94f..8db77da07c9 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7705,6 +7705,7 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Verbunden. ${setupLink ? `<a href="${setupLink}">Einrichtung abschließen</a>` : 'Einrichtung abschließen'} zum Importieren von Mitarbeitenden.</muted-text-label>`,
                 groups: {title: 'Gruppen', description: 'Wählen Sie die Mitarbeitergruppen aus, die Sie mit diesem Workspace synchronisieren möchten'},
+                syncLimitReached: {title: 'Versuchen Sie es morgen noch einmal', prompt: 'Sie haben Ihr Synchronisierungslimit für heute erreicht.'},
             },
         },
         emptyDomain: {
diff --git a/src/languages/es.ts b/src/languages/es.ts
index a1d8c166ea6..40f20dee9e0 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -6647,6 +6647,7 @@ ${amount} para ${merchant} - ${date}`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Conectado. ${setupLink ? `<a href="${setupLink}">Completa la configuración</a>` : 'Completar configuración'} para importar empleados.</muted-text-label>`,
                 groups: {title: 'Grupos', description: 'Elige los grupos de empleados que te gustaría sincronizar con este espacio de trabajo'},
+                syncLimitReached: {title: 'Inténtalo de nuevo mañana', prompt: 'Has alcanzado tu límite de sincronización de hoy.'},
             },
         },
         export: {
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index b6eded4cb85..6c7091e7109 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -7738,6 +7738,7 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Connecté. ${setupLink ? `<a href="${setupLink}">Terminer la configuration</a>` : 'Terminer la configuration'} pour importer les employés.</muted-text-label>`,
                 groups: {title: 'Groupes', description: 'Choisissez les groupes d’employés que vous souhaitez synchroniser avec cet espace de travail'},
+                syncLimitReached: {title: 'Réessayez demain', prompt: "Vous avez atteint votre limite de synchronisation pour aujourd'hui."},
             },
         },
         emptyDomain: {
diff --git a/src/languages/it.ts b/src/languages/it.ts
index efd84c1b63e..0e18e0e31ac 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7690,6 +7690,7 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Connesso. ${setupLink ? `<a href="${setupLink}">Completa la configurazione</a>` : 'Completa configurazione'} per importare i dipendenti.</muted-text-label>`,
                 groups: {title: 'Gruppi', description: 'Scegli i gruppi di dipendenti che vuoi sincronizzare con questo spazio di lavoro'},
+                syncLimitReached: {title: 'Riprova domani', prompt: 'Hai raggiunto il limite di sincronizzazioni per oggi.'},
             },
         },
         emptyDomain: {
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index c28af32576a..47e432f33c0 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7602,6 +7602,7 @@ ${reportName}`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>接続されました。従業員をインポートするには ${setupLink ? `<a href="${setupLink}">セットアップを完了</a>` : '設定を完了'} に接続してください。</muted-text-label>`,
                 groups: {title: 'グループ', description: 'このワークスペースと同期したい従業員グループを選択してください'},
+                syncLimitReached: {title: '明日もう一度お試しください', prompt: '本日の同期上限に達しました。'},
             },
         },
         emptyDomain: {
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index fad31d4c17f..7f015b1798e 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7668,6 +7668,7 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Verbonden. ${setupLink ? `<a href="${setupLink}">Instellen voltooien</a>` : 'Configuratie voltooien'} om werknemers te importeren.</muted-text-label>`,
                 groups: {title: 'Groepen', description: 'Kies de groepen werknemers die je met deze workspace wilt synchroniseren'},
+                syncLimitReached: {title: 'Probeer het morgen opnieuw', prompt: 'Je hebt je synchronisatielimiet voor vandaag bereikt.'},
             },
         },
         emptyDomain: {title: 'Verbeter je beveiliging met domeinen', subtitle: 'Vereis dat leden op je domein inloggen via single sign-on, beperk het aanmaken van werkruimtes en meer.'},
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 8f423f10c49..a827d2a2282 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7657,6 +7657,7 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Połączono. ${setupLink ? `<a href="${setupLink}">Zakończ konfigurację</a>` : 'Zakończ konfigurację'}, aby zaimportować pracowników.</muted-text-label>`,
                 groups: {title: 'Grupy', description: 'Wybierz grupy pracowników, które chcesz zsynchronizować z tą przestrzenią roboczą'},
+                syncLimitReached: {title: 'Spróbuj ponownie jutro', prompt: 'Osiągnąłeś dzienny limit synchronizacji.'},
             },
         },
         emptyDomain: {
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 165371fdccc..5dce99214ec 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7659,6 +7659,7 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>Conectado. ${setupLink ? `<a href="${setupLink}">Concluir configuração</a>` : 'Concluir configuração'} para importar funcionários.</muted-text-label>`,
                 groups: {title: 'Grupos', description: 'Escolha os grupos de funcionários que você gostaria de sincronizar com este workspace'},
+                syncLimitReached: {title: 'Tente novamente amanhã', prompt: 'Você atingiu o limite de sincronizações de hoje.'},
             },
         },
         emptyDomain: {
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index f229588b3cc..763c6590851 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7459,6 +7459,7 @@ ${reportName}`,
                 setupIncomplete: (setupLink: string | undefined) =>
                     `<muted-text-label>已连接。${setupLink ? `<a href="${setupLink}">完成设置</a>` : '完成设置'} 用于导入员工。</muted-text-label>`,
                 groups: {title: '群组', description: '选择要与此工作区同步的员工分组'},
+                syncLimitReached: {title: '请明天再试', prompt: '您已达到今日的同步上限。'},
             },
         },
         emptyDomain: {title: '通过域名提升安全性', subtitle: '要求您域中的成员通过单点登录登录、限制工作区创建等。'},

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/CONST/index.ts 94.81% <ø> (ø)
src/libs/actions/connections/MergeHR.ts 10.52% <0.00%> (-0.29%) ⬇️
src/pages/workspace/WorkspaceMembersPage.tsx 60.18% <0.00%> (-0.38%) ⬇️
src/pages/workspace/hr/HRProviderCard.tsx 0.00% <0.00%> (ø)
src/libs/HRUtils.ts 90.19% <58.33%> (-4.25%) ⬇️
... and 15 files with indirect coverage changes

@mhawryluk mhawryluk marked this pull request as ready for review July 2, 2026 10:03
@mhawryluk mhawryluk requested review from a team as code owners July 2, 2026 10:03
@melvin-bot melvin-bot Bot requested a review from bernhardoj July 2, 2026 10:03
@melvin-bot

melvin-bot Bot commented Jul 2, 2026

Copy link
Copy Markdown

@bernhardoj Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot Bot requested review from flaviadefaria and removed request for a team July 2, 2026 10:03
Comment thread src/pages/workspace/hr/HRProviderCard.tsx Outdated
Comment thread src/pages/workspace/WorkspaceMembersPage.tsx Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f3d725bf30

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/libs/HRUtils.ts
}

const windowStart = DateUtils.subtractMillisecondsFromDateTime(DateUtils.getDBTime(), CONST.MERGE_HR.MANUAL_SYNC_WINDOW_MS);
const syncsWithinWindow = manualSyncTimestamps.filter((timestamp) => timestamp > windowStart).length;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Surface 429 limit responses from the server

When this client does not already have two manualSyncTimestamps cached, this returns false and both sync entry points still call syncConnection; in the documented limit case the backend returns a 429 with empty onyxData, so syncMergeHR just applies its failureData and the user never sees the “try again tomorrow” popup. This also affects cases where another admin exhausts the workspace quota before this policy receives updated timestamps, so the 429 response itself needs to drive the modal rather than relying only on this local list.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

the scenario of calling syncConnection when the limit is reached is a very unlikely corner case. it can happen when some other admin scheduled a sync and then we click "Sync now" before we get the data pushed from backend. in that case we will likely show a generic error, which I think is fine

@mhawryluk

Copy link
Copy Markdown
Contributor Author

Hmm, so I do the sync multiple times before switching to this PR branch. When I switch to this PR branch and do the sync, no error or popup appears, which makes sense for the popup because no manualSyncTimestamps data yet on the onyx, so the sync within 24 hours count is always 0. But I think an error should be shown.

w.mp4
Even after I do "Clear cache and restart", the manualSyncTimestamps data is still not present on the onyx. Is this FE-only data? If yes, then step 7 can't be achieved.

Also, when failed, I think BE should return an error and the most recent manualSyncTimestamps data.

the error doesn't show up because failureData in the syncMergeHR action lacks a generic error, I will add it. It would be better if the backend didn't fail with error code 429 and instead set onyx values, but this scenario by design should not happen, the backend error is just a safety net if for some reason we do schedule the backend call when the limit is reached, but if everything works correctly it is very unlikely.

the manualSyncTimestamps data is not FE only, the backend is pushing it to all admins (the limit is per workspace, not per user). it works for me. @cristipaval could we look into the BE logs?

@bernhardoj

Copy link
Copy Markdown
Contributor

the manualSyncTimestamps data is not FE only, the backend is pushing it to all admins (the limit is per workspace, not per user). it works for me.

Hmm, could it be because my account is not on the beta 🤔? I'm currently hard-coding the isBetaEnabled to return true to use the HR feature. If that's the case, can anyone add my account to the beta? It's bernhard.josephus+0127@gmail.com.

@mhawryluk

Copy link
Copy Markdown
Contributor Author

the error doesn't show up because failureData in the syncMergeHR action lacks a generic error, I will add it.

actually, it was because the syncStatus was not set to "FAILED". should be fixed now

@mhawryluk mhawryluk requested a review from bernhardoj July 7, 2026 09:27
@cristipaval

Copy link
Copy Markdown
Contributor

I investigated this and checked the backend logs. During that time, the @bernhardoj's sync calls were timing out on the backend and returning 500. Failed tries still count against the daily limit but add no manual sync timestamp, so after 2 tries 429 was received for the rest of the day. That is why manualSyncTimestamps never showed up.

Let's try again now, the backend issues should be gone.

@bernhardoj

bernhardoj commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

There is a generic error now when it fails, but I still get 429 with no onyxData (for manualSyncTimestamps).

image

(still time out when I sync)

@mhawryluk

mhawryluk commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

There is a generic error now when it fails, but I still get 429 with no onyxData (for manualSyncTimestamps).

image (still time out when I sync)

I think it's intended, you should be getting manualSyncTimestamps after scheduling manual syncs that are within the limit. once the limit is reached we should already have this data, so the error 429 does not have to send it. so the issue is why were you able to make the manual sync when the limit has been reached already. maybe this particular workspace's data is corrupted? could you try with a different workspace/provider?
cc: @cristipaval

@mhawryluk

Copy link
Copy Markdown
Contributor Author

(still time out when I sync)

oh, so the first two manual syncs today timed out and in that case the backend didn't update manualSyncTimestamps (a confirmed backend bug, if I understand correctly) and then the third one resulted in error 429?

@bernhardoj

bernhardoj commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

oh, so the first two manual syncs today timed out and in that case the backend didn't update manualSyncTimestamps (a confirmed backend bug, if I understand correctly) and then the third one resulted in error 429?

Yes, this is the case

I think BE should always return the manualSyncTimestamps so the FE always have the latest value. It's useful for several cases, one of them is the above. Another one I'm thinking is, on client A, the user syncs twice. On client B, the user tries to sync again, but it reaches the limit, and since client B doesn't have the manualSyncTimestamps yet, no popup appears, and the BE should return an error along with the latest manualSyncTimestamps. Then, the next sync attempt will show the limit popup.

@mhawryluk

Copy link
Copy Markdown
Contributor Author

I think BE should always return the manualSyncTimestamps so the FE always have the latest value. It's useful for several cases, one of them is the above. Another one I'm thinking is, on client A, the user syncs twice. On client B, the user tries to sync again, but it reaches the limit, and since client B doesn't have the manualSyncTimestamps yet, no popup appears, and the BE should return an error along with the latest manualSyncTimestamps. Then, the next sync attempt will show the limit popup.

I believe manualSyncTimestamps updates are pushed to all admins via the pusher, so this should be enough

@cristipaval

Copy link
Copy Markdown
Contributor

Thanks for testing @bernhardoj, this was very helpful. Your testing found two real backend bugs:

  1. The manual sync times out. The backend takes several minutes to answer a "Sync now", so the request always times out on the client. Today your syncs ran for 8-15 minutes before failing.

  2. The 429 comes with no onyxData. When the daily limit is hit, the backend returns 429 but does not send manualSyncTimestamps, so other clients can't see the limit is reached.

Both are backend problems, not the frontend. Your change is fine. I will open the backend follow-ups.

@bernhardoj

Copy link
Copy Markdown
Contributor

Please let me know once the BE is fixed

@cristipaval

Copy link
Copy Markdown
Contributor

@bernhardoj the backend is now fixed. Could you please retest? 🙏

@cristipaval

Copy link
Copy Markdown
Contributor

@mhawryluk, now that the beta has been removed, I think we could remove the [No QA] prefix from the title and let the PR take the regular path

@mhawryluk mhawryluk changed the title [NoQA] [HR Import] Handle Merge daily sync limit error with popup [HR Import] Handle Merge daily sync limit error with popup Jul 10, 2026
@bernhardoj

Copy link
Copy Markdown
Contributor

Thanks, manualSyncTimestamps is now returned when the sync is timed out.

@bernhardoj

bernhardoj commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
android.mp4
Android: mWeb Chrome
android.mweb.mp4
iOS: HybridApp
ios.mp4
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4

@melvin-bot melvin-bot Bot requested a review from cristipaval July 10, 2026 11:32
@cristipaval cristipaval merged commit 5b52fc0 into Expensify:main Jul 10, 2026
39 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 cristipaval has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

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

@mvtglobally

mvtglobally commented Jul 10, 2026

Copy link
Copy Markdown

@twisterdotcom @bernhardoj @cristipaval Is the Merge HR still under manually configured BETA? We only have 1 account previously setup which had already connected. Or we can now use any Expensifail account?
To ensure we run this across 3 platforms, can you add 3 more accounts to BETA or how should we proceed?

We could potentially use new accounts like these
applausetester+bamboohr1@applause.expensifail.com
applausetester+bamboohr2@applause.expensifail.com
applausetester+bamboohr3@applause.expensifail.com

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/cristipaval in version: 9.4.33-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 cancelled 🔪

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 No help site changes required.

This PR adds a 2-per-day manual sync limit for Merge HR connections and shows a "Try again tomorrow" / "You've reached your sync limit for the day." modal when the limit is reached. The Merge HR providers are Workday, BambooHR, and HiBob (MERGE_HR_PROVIDERS.ts), and all three help articles already document this exact behavior on main:

Each article already states, in both the "Sync now" section and an FAQ:

Manual syncs are limited to two per day. If you've reached the limit, you'll see You've reached your sync limit for the day.

Manual syncs are limited to two per day. If you've already synced twice, the next sync runs automatically the following day.

That matches the modal copy shipped in this PR (syncLimitReached.prompt = "You've reached your sync limit for the day.") and the MANUAL_SYNC_LIMIT: 2 / 24-hour window logic. TriNet and Gusto are not Merge HR providers, so the new modal doesn't apply to them, and their docs correctly don't mention the limit.

Because the help site already reflects this behavior accurately, I did not open a draft docs PR — there's nothing to change. If you'd like the articles to also mention the per-workspace enforcement (one admin hitting the limit blocks the others) or the Members > More > Sync with <provider> entry point, let me know and I'll draft a PR adding that.

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.

8 participants