Skip to content

fix: address audit findings (router guards, platforms, example, CI, docs) - #20

Merged
iletai merged 4 commits into
developfrom
fix/audit-findings
Nov 2, 2026
Merged

iletai merged 4 commits into
developfrom
fix/audit-findings

Conversation

@iletai

@iletai iletai commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Description

Fixes the findings from the 2026-11-02 audit (logic, specs, platform support, integration).

Library

  • push, replacePath, present(sheet:), present(cover:) return Bool (@discardableResult) and log rejections through os.Logger, instead of failing silently.
  • maxDepth is clamped to >= 1 on every assignment. Assigning a negative value previously crashed replacePath (prefix(-1)). initialPath is truncated to maxDepth.
  • Sheet and cover are mutually exclusive through the router API (SwiftUI cannot present both from the same view).
  • macOS presents covers as sheets instead of ignoring them (previously dismiss() cleared an invisible cover before popping).
  • send(_:) returns its Task so callers can await ordering.
  • Package.swift declares tvOS 17 / watchOS 10 / visionOS 1 (README already advertised them); redundant StrictConcurrency flag removed.
  • Removed redundant @unchecked Sendable and the public Collection.subscript(safe:) / Array.removeLastSafe() helpers.
  • BaseNavigationContainer reuses the navigationRouter modifier (removes duplicated #if branches).

Example app: removed ~380 lines of unused v1 views that would trap if built (no environment injection), moved to Swift 6 mode, fixed the actor-isolation warning in AsyncLabView.

CI: macos-26 with latest stable Xcode, pinned SwiftLint 0.65.1, iOS job fails when no simulator exists instead of passing on build-only, new tvOS/watchOS/visionOS and example-app build jobs. Release workflow accepts tags with or without v and runs tests first.

Docs: fixed the deep-link parsing example (myapp://detail/42 returned []), modifier/toolbar placement, v1 urlHandler retain cycle, undefined example types, migration guide; added CHANGELOG.md.

Motivation & Context

Library is used as a base across several apps; silent rejections, a reachable crash, and platforms promised but not declared made integration unreliable.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation / CI update

Breaking: public subscript(safe:) / removeLastSafe() removed. Because the mutating methods now return Bool, generic single-expression closures like MainActor.run { router.push(x) } warn about an unused result (call await router.push(x) instead). Both are listed in CHANGELOG.md.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed (swift test).

Verification

  • swift test: 24 tests, 0 failures (macOS). xcodebuild test on iPhone simulator: pass.
  • Builds: iOS, Mac Catalyst; tvOS 17 / watchOS 10 / visionOS 1 typechecked with swiftc (platform runtimes not installed locally — new CI jobs cover real builds).
  • swiftlint --strict: clean. Example app builds in Swift 6 mode with 0 warnings.
  • Edited README/wiki snippets compiled in a scratch consumer package.

Not verified

  • New CI jobs have not run yet (macos-26 runner availability and preinstalled tvOS/watchOS/visionOS platforms are assumptions).
  • Runtime UI behavior (Liquid Glass, nested stacks, environment propagation from the modifier) — needs simulator/UI tests.

…rs on macOS

- push/replacePath/present return Bool and log rejections via os.Logger
- maxDepth clamped on every assignment (negative value crashed replacePath)
- initialPath truncated to maxDepth; sheet and cover mutually exclusive
- macOS shows covers as sheets instead of silently ignoring them
- send returns its Task so callers can await ordering
- declare tvOS 17 / watchOS 10 / visionOS 1; drop redundant StrictConcurrency flag
- remove @unchecked Sendable and public Collection/Array helpers (breaking)
- container reuses navigationRouter modifier; fix flaky send test, add guard tests
Copilot AI balanced review requested due to automatic review settings November 2, 2026 14:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@iletai
iletai merged commit 18c9836 into develop Nov 2, 2026
7 checks passed
@iletai
iletai deleted the fix/audit-findings branch November 2, 2026 14:31
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