Skip to content

fix(swift): flush the outbox from macOS standalone Pack/Trip windows - #2676

Merged
mikib0 merged 1 commit into
developmentfrom
fix/swift-macos-outbox-flush
Aug 10, 2026
Merged

fix(swift): flush the outbox from macOS standalone Pack/Trip windows#2676
mikib0 merged 1 commit into
developmentfrom
fix/swift-macos-outbox-flush

Conversation

@mikib0

@mikib0 mikib0 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Follow-up to #2673 (merged), which added the offline write outbox.

Problem

On macOS a pack or trip can be opened in its own window (Open in New Window), and those windows host the same detail views as the main window — so they queue writes of their own through PackDetailView's deleteItem / updateItem.

Only the main window carried .flushesPendingWrites(). Writes made in a standalone window were queued correctly but that window never drained them, so sync stalled until the user returned to the main window.

This is not data loss — PendingMutation rows are durable and the main window still flushes on foreground and reconnect — but it's a real stall for anyone working primarily in a standalone window.

Change

Attach .flushesPendingWrites() to both macOS WindowGroups. OutboxService.flush already guards on isFlushing, so multiple windows cannot double-send a mutation.

Scope

PackRat-macOS compiles the same Sources/PackRat as the iOS target, so the outbox itself was already present on macOS — this closes the one platform-specific gap in how it gets drained.

Testing

Not verified on a running macOS build. The original outbox work was device-tested end-to-end on iOS (offline create and delete reaching a live API); this change is the same modifier already proven there, applied to two additional scenes.

On macOS a pack or trip can be opened in its own window, and those windows host
the same detail views as the main window — so they queue writes of their own via
`PackDetailView`'s deleteItem/updateItem.

Only the main window carried `.flushesPendingWrites()`, so writes made in a
standalone window stayed queued until the user returned to the main window.
Not data loss (mutations are durable and the main window still flushes on
foreground/reconnect), but sync stalls for anyone working primarily in a
standalone window.

Attach the modifier to both macOS `WindowGroup`s. `OutboxService.flush` already
guards on `isFlushing`, so multiple windows cannot double-send a mutation.

Refs #2672
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@mikib0, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 9 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bf18de68-17ff-46e3-9cca-48b27fae850b

📥 Commits

Reviewing files that changed from the base of the PR and between acdcabf and 5a85d4a.

📒 Files selected for processing (1)
  • apps/swift/Sources/PackRat/PackRatApp.swift

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/units (./packages/units)

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 100%) 35 / 35
🟢 Statements 100% (🎯 100%) 35 / 35
🟢 Functions 100% (🎯 100%) 6 / 6
🟢 Branches 100% (🎯 100%) 11 / 11
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/utils (./packages/utils)

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 100%) 92 / 92
🟢 Statements 100% (🎯 100%) 92 / 92
🟢 Functions 100% (🎯 100%) 1 / 1
🟢 Branches 100% (🎯 100%) 1 / 1
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/analytics (./packages/analytics)

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 80%) 745 / 745
🟢 Statements 100% (🎯 80%) 745 / 745
🟢 Functions 100% (🎯 85%) 48 / 48
🟢 Branches 87.35% (🎯 80%) 152 / 174
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for apps/expo (./apps/expo)

Status Category Percentage Covered / Total
🟢 Lines 97.64% (🎯 95%) 623 / 638
🟢 Statements 97.64% (🎯 95%) 623 / 638
🟢 Functions 100% (🎯 97%) 52 / 52
🟢 Branches 95.19% (🎯 92%) 218 / 229
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/overpass (./packages/overpass)

Status Category Percentage Covered / Total
🟢 Lines 100% (🎯 80%) 155 / 155
🟢 Statements 100% (🎯 80%) 155 / 155
🟢 Functions 100% (🎯 80%) 13 / 13
🟢 Branches 95.65% (🎯 70%) 44 / 46
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/mcp (./packages/mcp)

Status Category Percentage Covered / Total
🟢 Lines 99.41% (🎯 80%) 4273 / 4298
🟢 Statements 99.41% (🎯 80%) 4273 / 4298
🟢 Functions 100% (🎯 80%) 101 / 101
🟢 Branches 98.67% (🎯 80%) 597 / 605
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for packages/api (./packages/api)

Status Category Percentage Covered / Total
🟢 Lines 99.01% (🎯 95%) 1906 / 1925
🟢 Statements 99.01% (🎯 95%) 1906 / 1925
🟢 Functions 100% (🎯 97%) 100 / 100
🟢 Branches 97.08% (🎯 92%) 665 / 685
File CoverageNo changed files found.
Generated in workflow #584 for commit 5a85d4a by the Vitest Coverage Report Action

@mikib0
mikib0 merged commit e9d3c81 into development Aug 10, 2026
24 checks passed
@mikib0
mikib0 deleted the fix/swift-macos-outbox-flush branch August 10, 2026 09:28
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.

1 participant