App: [$250] [QBO] "Last synced just now" text doesn't update

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: v1.4.66-0 Reproducible in staging?: Y Reproducible in production?: If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @trjExpensify Slack conversation: https://expensify.slack.com/archives/C036QM0SLJK/p1714057390428649?thread_ts=1714057353.559839&cid=C036QM0SLJK

Action Performed:

  1. Connect to QBO
  2. Observe the “Last synced just now” text
  3. Go have a coffee for 10mins
  4. Come back
  5. Observe the text still reads “Last synced just now”

Expected Result:

On OldDot the way we handle it is by checking the lastSync timestamp from the policy on page load, and then compute a human-friendly time difference with it. Every time you/auto-sync syncs the connection it’s updated here.

Actual Result:

Despite hours elapsing the text still reads: “Last synced just now” even after a page refresh, suggesting this is just a static value currently.

Workaround:

N/A

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

image

View all open jobs on GitHub

CC: @hayata-suenaga @aldo-expensify @teneeto @narefyev91 @zanyrenney

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016f30631fa560635c
  • Upwork Job ID: 1783647518731452416
  • Last Price Increase: 2024-04-26
  • Automatic offers:
    • Ollyws | Reviewer | 0
    • tienifr | Contributor | 0

About this issue

  • Original URL
  • State: open
  • Created 2 months ago
  • Comments: 20 (14 by maintainers)

Most upvoted comments

@tienifr please go ahead and raise the PR

Proposal

Please re-state the problem that we are trying to solve in this issue.

Despite hours elapsing the text still reads: “Last synced just now” even after a page refresh, suggesting this is just a static value currently.

What is the root cause of that problem?

We’re showing Last synced just now in

https://github.com/Expensify/App/blob/42d4ed7b72dc979df430a2a7eac4ba30a3eac790/src/pages/workspace/accounting/PolicyAccountingPage.tsx#L98-L100

and it’s just a static value

What changes do you think we should make in order to solve the problem?

  1. BE should return new value to indicate the lastSync timestamp (SyncPolicyToQuickbooksOnline command). We need to update it optimistically too
  2. Use it value to calculate the difference in time from lastSync to the current time

We can update this value every 10 mins (5 mins, …)

What alternative solutions did you explore? (Optional)

NA