Skip to content

Gate iMessage local sync to macOS in serve to eliminate unsupported-platform warnings#2

Merged
chz160 merged 4 commits into
mainfrom
copilot/fix-local-platform-sync-warning
May 11, 2026
Merged

Gate iMessage local sync to macOS in serve to eliminate unsupported-platform warnings#2
chz160 merged 4 commits into
mainfrom
copilot/fix-local-platform-sync-warning

Conversation

Copy link
Copy Markdown

Copilot AI commented May 11, 2026

openmessage serve was attempting iMessage local DB sync on Windows, producing repeated warnings like load chats: unable to open database file under platform=imessage. This change limits iMessage background sync to supported OS behavior so Windows/Linux runs stop surfacing misleading iMessage importer errors.

  • Behavior change: platform-gated iMessage sync

    • Wrapped periodic iMessage sync in an OS support check.
    • serve now skips iMessage local sync unless running on Darwin.
  • Code structure: shared Darwin predicate

    • Introduced a shared isDarwin() helper and reused it from both notification gating and iMessage sync support checks.
    • Keeps platform checks consistent and avoids duplicated GOOS comparisons.
  • Coverage: explicit sync support test

    • Added TestIMessageSyncSupported to verify:
      • darwin => supported
      • windows => unsupported
if iMessageSyncSupported() {
    syncPlatform("imessage", "iMessage sync complete", func(store *db.Store) (*importer.ImportResult, error) {
        return (&importer.IMessage{MyName: identityName}).ImportFromDB(store)
    })
}

Copilot AI and others added 4 commits May 11, 2026 00:35
Agent-Logs-Url: https://github.com/chz160/openmessage/sessions/86acf90b-56f8-45a6-934b-c55cd4979791

Co-authored-by: chz160 <3420276+chz160@users.noreply.github.com>
…-platform warnings

Agent-Logs-Url: https://github.com/chz160/openmessage/sessions/86acf90b-56f8-45a6-934b-c55cd4979791

Co-authored-by: chz160 <3420276+chz160@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents openmessage serve from attempting iMessage local database sync on unsupported operating systems by gating the periodic iMessage sync path to macOS (Darwin). This reduces noisy/ misleading warnings on Windows/Linux while keeping existing macOS behavior intact.

Changes:

  • Gate periodic iMessage local sync behind a iMessageSyncSupported() check (Darwin-only).
  • Introduce a shared isDarwin() helper and reuse it from the macOS notifications default-path and iMessage sync gating.
  • Add a unit test verifying iMessage sync support behavior across darwin vs windows.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
go.mod Promotes several already-imported dependencies from indirect to direct requirements (module bookkeeping).
cmd/serve.go Skips periodic iMessage local sync unless running on Darwin; centralizes GOOS check in isDarwin().
cmd/serve_test.go Adds TestIMessageSyncSupported to validate Darwin-only support behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chz160 chz160 marked this pull request as ready for review May 11, 2026 00:49
@chz160 chz160 merged commit ce82209 into main May 11, 2026
4 checks passed
@chz160 chz160 deleted the copilot/fix-local-platform-sync-warning branch May 11, 2026 00:49
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.

3 participants