Skip to content

perf(mobile): TAM-7126: skip sync save transaction when there’s nothing to pull - #11092

Merged
jaskfla merged 4 commits into
mainfrom
tam-7126-1-skip-noop-save
Sep 15, 2026
Merged

jaskfla merged 4 commits into
mainfrom
tam-7126-1-skip-noop-save

Conversation

@jaskfla

@jaskfla jaskfla commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

Changes

Part 1 of 4 of a stack (TAM-7126) that stops mobile sync scanning the whole database on every run; context in TAM-7089 items #1 and #8.

A zero-record incremental pull currently still creates the snapshot table, opens the write-locking save transaction and runs the dependency sort and the whole-database foreign key check inside it, every five minutes. Most syncs on a settled device are exactly this case. This change returns early and only advances the pull cursor (which must still move to pullUntil, otherwise the next session re-asks from the old tick).

Stack: this#11093#11094#11095.

Auto-Deploy

  • Deploy
Options
  • Artillery load test
  • Seed from closest snapshot
  • Generate fake data
  • More data (20Gi)
  • No facility servers (central-only)
  • No sync (facility tasks scaled to zero)
  • Skip mobile build
  • Always build mobile
  • Stay up for 8 hours
  • Stay up for 24 hours
  • Stay up (no TTL)
  • Build images only (don't deploy)
  • Build all images (amd64 + Windows; default is arm64 only)
  • Pause this deploy

Tests

  • Run E2E tests
  • Run DAST scan

Review Hero

  • Run Review Hero
  • Auto-fix review suggestions Wait for Review Hero to finish, resolve any comments you disagree with or want to fix manually, then check this to auto-fix the rest.
  • Auto-fix CI failures Check this to auto-fix lint errors, test failures, and other CI issues.
  • Auto-merge upstream Check this to merge the base branch into this PR, with AI conflict resolution if needed.
  • Save suppressions Check this to capture 👎 reactions on Review Hero comments as suppression rules in .github/review-hero/suppressions.yml. Also runs automatically at the end of any auto-fix run.

Remember to...

  • ...write or update tests
  • ...add UI screenshots and testing notes to the Linear issue
  • ...add any manual upgrade steps to the Linear issue
  • ...update the config reference, settings reference, or any relevant runbook(s)
  • ...call out additions or changes to config files for the deployment team to take note of

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 0348c9a. Configure here.

Comment thread packages/mobile/App/services/sync/MobileSyncManager.ts
@review-hero

review-hero Bot commented Sep 14, 2026

Copy link
Copy Markdown

🦸 Review Hero Summary (round 1)
5 agents reviewed this PR | 1 failed | 0 critical | 0 suggestions | 0 nitpicks | Filtering: consensus 3 voters

No issues found. Looks good!

@jaskfla
jaskfla force-pushed the tam-7126-1-skip-noop-save branch 2 times, most recently from c0ecc05 to 7f75791 Compare September 14, 2026 03:47
@jaskfla jaskfla changed the title perf(mobile): TAM-7126: skip the sync save transaction when there is nothing to pull perf(mobile): TAM-7126: skip sync save transaction when there’s nothing to pull Sep 14, 2026
@review-hero

review-hero Bot commented Sep 14, 2026

Copy link
Copy Markdown

🦸 Review Hero Summary (round 2)
4 agents reviewed this PR | 2 failed | 0 critical | 0 suggestions | 0 nitpicks | Filtering: consensus 3 voters

No issues found. Looks good!

@jaskfla
jaskfla marked this pull request as ready for review September 14, 2026 05:12

@dannash100 dannash100 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.

good stuff

@jaskfla
jaskfla requested a review from dannash100 September 14, 2026 23:35
…nothing to pull

A zero-record incremental pull still created the snapshot table, opened the
(write-locking) save transaction and ran the dependency sort and foreign key
check inside it, every five minutes. Now it only advances the pull cursor.

The pull count is a Postgres bigint that arrives serialised as a string, so it
is coerced to a number where it enters the app; otherwise this gate (and the
existing one in pullRecordsInBatches) never matches.
@jaskfla
jaskfla force-pushed the tam-7126-1-skip-noop-save branch from fdbfee5 to bbceccb Compare September 14, 2026 23:39

@dannash100 dannash100 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.

Looks gud

@jaskfla
jaskfla added this pull request to the merge queue Sep 14, 2026
Merged via the queue into main with commit 7a332e5 Sep 15, 2026
62 checks passed
@jaskfla
jaskfla deleted the tam-7126-1-skip-noop-save branch September 15, 2026 00:15
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.

2 participants