Skip to content

chore(samples): macos builds - #2865

Merged
renefloor merged 4 commits into
masterfrom
chore/macos-run
Aug 4, 2026
Merged

chore(samples): macos builds#2865
renefloor merged 4 commits into
masterfrom
chore/macos-run

Conversation

@renefloor

@renefloor renefloor commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Submit a pull request

Github Issue: related to #2862

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested (add some information if not applicable)

Description of the pull request

The macos project files were a bit outdated. Also it is a bit tricky to use keychain storage on development builds, so I would just disable that for the sample app.

Summary by CodeRabbit

  • Bug Fixes

    • Credential persistence is now disabled on macOS, matching web platform behavior where persistence is unsupported.
    • macOS connection and disconnection flows now consistently respect platform credential-storage capabilities.
  • Build & Platform Updates

    • Improved macOS project configuration and dependency integration.
    • macOS builds now prepare required Flutter frameworks automatically, improving build reliability.

@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 19bb26f3-d864-4e02-b3d7-8e40443f8875

📥 Commits

Reviewing files that changed from the base of the PR and between 48dd57f and 1ef0b07.

📒 Files selected for processing (1)
  • sample_app/lib/auth/auth_controller.dart

📝 Walkthrough

Walkthrough

The change centralizes credential persistence checks and excludes macOS. It also updates macOS Flutter configuration, links the generated Swift package, removes the CocoaPods resource-copy phase, and prepares Flutter before builds.

Changes

Credential persistence policy

Layer / File(s) Summary
Centralized persistence eligibility
sample_app/lib/auth/auth_controller.dart
The new getter excludes web and macOS. Auto-connect, connect, disconnect, and reset use the centralized check.

macOS Flutter build integration

Layer / File(s) Summary
Configuration and package setup
sample_app/macos/Flutter/*, sample_app/macos/Runner.xcodeproj/project.pbxproj
The macOS configurations include generated Flutter settings. The Runner references and links FlutterGeneratedPluginSwiftPackage.
Build preparation and resource phase update
sample_app/macos/Runner.xcodeproj/project.pbxproj, sample_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
The project removes the CocoaPods resource-copy phase. The scheme runs macos_assemble.sh prepare before builds.

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

Sequence Diagram(s)

sequenceDiagram
  participant RunnerScheme
  participant macos_assemble.sh
  participant FlutterGeneratedPluginSwiftPackage
  RunnerScheme->>macos_assemble.sh: Run prepare before build
  macos_assemble.sh->>FlutterGeneratedPluginSwiftPackage: Prepare generated package
  RunnerScheme->>FlutterGeneratedPluginSwiftPackage: Link package product
Loading

Suggested reviewers: testableapple

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'chore(samples): macos builds' is generic and does not convey the specific technical changes. It mentions macOS builds but omits the critical keychain persistence refactoring and does not clarify what changes were made. Update the title to reflect both main changes: the keychain persistence refactoring in auth_controller.dart and the macOS project configuration updates. Example: 'chore(samples): disable keychain persistence on development and update macos builds' or similar.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/macos-run

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.

import 'package:stream_chat_flutter/stream_chat_flutter.dart' hide PushProvider;
import 'package:stream_chat_persistence/stream_chat_persistence.dart';

bool get platformSupportsPersistenceCredentials => !CurrentPlatform.isWeb && !CurrentPlatform.isMacOS;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But the package mentions MacOs as supported
https://pub.dev/packages/flutter_secure_storage

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@sample_app/lib/auth/auth_controller.dart`:
- Around line 13-14: Update tryAutoConnect() and debugReset() to use
platformSupportsPersistenceCredentials as the guard before reading or deleting
kStreamApiKey, kStreamUserId, and kStreamToken. Replace the web-only check in
tryAutoConnect() and apply the same shared guard to debugReset(), ensuring
unsupported macOS and web platforms never access these credentials.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1358ef21-1165-43ee-adb3-2858c76284be

📥 Commits

Reviewing files that changed from the base of the PR and between 1616091 and 48dd57f.

📒 Files selected for processing (5)
  • sample_app/lib/auth/auth_controller.dart
  • sample_app/macos/Flutter/Flutter-Debug.xcconfig
  • sample_app/macos/Flutter/Flutter-Release.xcconfig
  • sample_app/macos/Runner.xcodeproj/project.pbxproj
  • sample_app/macos/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Comment thread sample_app/lib/auth/auth_controller.dart
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.87%. Comparing base (0ec7ee3) to head (1ef0b07).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2865   +/-   ##
=======================================
  Coverage   72.87%   72.87%           
=======================================
  Files         429      429           
  Lines       27716    27716           
=======================================
  Hits        20199    20199           
  Misses       7517     7517           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@renefloor
renefloor enabled auto-merge (squash) August 4, 2026 13:05
@renefloor
renefloor merged commit 252a472 into master Aug 4, 2026
26 checks passed
@renefloor
renefloor deleted the chore/macos-run branch August 4, 2026 13:13
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