Skip to content

fix: improve Mac connectivity and session handling - #26

Merged
MRL-00 merged 1 commit into
mainfrom
codex/fix-connectivity-sessions
Aug 2, 2026
Merged

MRL-00 merged 1 commit into
mainfrom
codex/fix-connectivity-sessions

Conversation

@MRL-00

@MRL-00 MRL-00 commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Fix cold-start Mac detection, bounded main-page refreshes, project-folder error handling, and session creation/navigation.

What changed

  • retry Mac discovery at startup and when returning to the foreground
  • bound manual refresh requests and prevent stale overlapping loads
  • show folder browsing and add-project failures instead of silently ignoring them
  • add a session menu for creating and switching sessions
  • surface session creation failures
  • bump the iOS build number to 20 for TestFlight

User impact

Macs should appear online without first visiting Manage Macs, refreshes finish, selected project folders appear or report a useful error, and users can start new sessions within an existing workspace.

Validation

  • iOS Simulator Debug build passed
  • git diff checks passed
  • no server files changed

Known warnings or follow-ups

The existing UIScreen.main iOS 26 deprecation warning remains unrelated to this change.

Summary by CodeRabbit

  • New Features

    • Added a toolbar menu for creating new chat sessions and switching between existing sessions.
    • Selecting a session restores its conversation, model settings, and message updates.
    • Chat drafts are preserved when session creation fails.
  • Bug Fixes

    • Improved project loading with retries, cancellation, and protection against outdated results.
    • Added clear error messages for failed project, folder, session, and server requests.
    • Improved Mac connection status and refresh behavior when returning to the app.
    • Folder confirmation is disabled while folder contents are loading.

@cursor

cursor Bot commented Aug 2, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fe534703-44eb-4bf4-870c-75b7375b0b65

📥 Commits

Reviewing files that changed from the base of the PR and between b169b74 and b752ab3.

📒 Files selected for processing (4)
  • PiMobile.xcodeproj/project.pbxproj
  • PiMobile/APIClient.swift
  • PiMobile/Views/ChatView.swift
  • PiMobile/Views/ProjectsView.swift

📝 Walkthrough

Walkthrough

The PR updates API timeout and error handling, adds retry and stale-load protection for projects, adds chat session creation and switching flows, and increments the Debug and Release project versions.

Changes

App reliability and session management

Layer / File(s) Summary
API timeout and error handling
PiMobile/APIClient.swift
APIClient.get applies request timeouts and decodes non-200 responses as APIError.server. repos(on:) accepts an optional timeout.
Project loading and folder feedback
PiMobile/Views/ProjectsView.swift
ProjectsView adds bounded retries, cancellation, stale-load suppression, scene activation refreshes, connectivity states, project error alerts, and folder-loading feedback.
Chat session creation and switching
PiMobile/Views/ChatView.swift
ChatView adds session creation state, session selection, explicit creation errors, draft restoration, message refreshes, and polling resumption.
Build version update
PiMobile.xcodeproj/project.pbxproj
Debug and Release configurations increase CURRENT_PROJECT_VERSION from 18 to 20.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProjectsView
  participant APIClient
  participant MacServer
  ProjectsView->>APIClient: Request repositories with timeout
  APIClient->>MacServer: Send HTTP request
  MacServer-->>APIClient: Return repositories or HTTP error
  APIClient-->>ProjectsView: Return result
  ProjectsView->>ProjectsView: Retry, cancel, or discard stale result
Loading

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-connectivity-sessions

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.

@MRL-00
MRL-00 marked this pull request as ready for review August 2, 2026 19:19
@MRL-00
MRL-00 merged commit ce79be1 into main Aug 2, 2026
1 check passed
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