Skip to content

Expand Shipyard release tools and submission diagnostics - #40

Closed
NayanBhut wants to merge 6 commits into
mainfrom
codex/fix-locale-selection
Closed

NayanBhut wants to merge 6 commits into
mainfrom
codex/fix-locale-selection

Conversation

@NayanBhut

@NayanBhut NayanBhut commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Shipyard now supports more of the App Store release workflow and explains why Apple rejects a submission. Instead of stopping at “This resource cannot be reviewed,” submission failures show the original nested validation errors, affected fields, suggested fixes, and a guarded retry flow.

Changes

  • Add TestFlight feedback with screenshots, crash logs, and local filtering, and preload App Store versions for app listings.
  • Add pricing and availability views and reviewed future base-price changes.
  • Add Shortcuts/Spotlight actions and refine app navigation, beta groups, and review workflows.
  • Display App Store Connect app identifiers in Apple ID fields.
  • Share screenshot/video data between App Info and the media manager, add App Preview uploads, show Apple's delivery states, preserve device selection, and reconcile interrupted upload reservations before retrying.
  • Preserve and recursively flatten JSON:API submission errors, deduplicate visible issues, and show a Submission Issues sheet with technical details and copy support. Retry requires fresh validation, respects Retry-After, and reuses/reconciles partial submission drafts.
  • Run test hosts in fixture mode with HTTP(S) blocked and production credentials excluded.

Initial pricing setup, existing future base-price schedules, and general availability edits remain in App Store Connect.

Validation

  • plutil -lint "App Store.xcodeproj/project.pbxproj" passed.
  • Required build passed:
    xcodebuild -project "App Store.xcodeproj" -scheme "App Store" -sdk macosx -configuration Debug CODE_SIGNING_ALLOWED=NO CODE_SIGN_IDENTITY="" build -skipMacroValidation
  • 250 unit tests passed, including 23 submission error/transaction tests.
  • All 25 UI cases passed across the full suite and focused reruns, including five new submission-issues cases. The focused rerun corrected XCTest's long-text query limit.
  • The shared scheme was separately verified without environment overrides: all 23 submission tests and the fail-closed UI launch test passed.
  • UI checks used offline fixtures; no live App Store submission or write was performed during these checks.

Submission test cases

@github-actions

Copy link
Copy Markdown

🤖 Ollama Cloud PR Review (Model: kimi-k3:cloud)

Code Review: TestFlight Feedback + Pricing & Availability

Overall this is a very strong PR — extensive test coverage, careful handling of uncertain pricing writes, stale-response protection, and good security hygiene (HTTPS-only screenshots, no JWT/cookies on signed attachment URLs, cursor extraction instead of forwarding links.next). Findings below, ordered by severity.


Medium Severity

  • [BUG]

  • Severity: [MEDIUM]

  • File: BetaFeedbackViewModel.swift (line ~157, in load(refresh:more:))

  • Description: Every non-pagination load calls select(nil) before the request completes. A user reading a crash log or viewing a screenshot who presses Refresh immediately loses the detail pane (and any loaded log state), even when the same submission comes back unchanged. Selection is only meaningful to clear if the item actually disappears.

  • Suggestion: Keep the current selection during refresh; after a successful load, clear it only if the new item list no longer contains selectedID (the view's onChange(of: filteredItems) already handles the filtered-out case). At minimum, don't clear until the refresh succeeds.

  • [SECURITY]

  • Severity: [MEDIUM]

  • File: BetaFeedbackModels.swift (lines 20–24) and BetaFeedbackViewModel.swift (live screenshot closure, lines ~20–41)

  • Description: secureURL accepts any https host and the fetcher downloads the body unbounded into memory and decodes it as NSImage. A malformed or tampered feedback payload could cause the app to fetch arbitrary hosts (SSRF-style, e.g. intranet addresses) or a very large body, exhausting memory. Also, value.host != nil can pass with an empty host for edge-case URLs like https://, and URL(string:) is more permissive than URLComponents for delimiter tricks.

  • Suggestion:

    1. Validate with URLComponents and require host?.isEmpty == false.
    2. Cap the download size (check Content-Length and/or stream with a byte limit).
    3. If feasible without breaking real signed URLs, note in a comment why arbitrary hosts are accepted (Apple CDN hostnames vary), or apply a light allowlist via a config constant.
  • [PERFORMANCE]

  • Severity: [MEDIUM]

  • File: BetaFeedbackModels.swift (lines 77–84) and PricingModels.swift (lines 99–117)

  • Description: BetaFeedbackItem.date(_:), PricingDisplay.day(_:), and validDay(_:) allocate a new ISO8601DateFormatter/DateFormatter on every call. createdDate is evaluated per row per view render in BetaFeedbackView, and today is read by many computed properties (editBlockReason, priceRows, currentBasePrice). Formatter allocation is one of the most expensive common Foundation operations — this runs inside list rendering hot paths.

  • Suggestion: Cache the formatters as static let (all call sites here are @MainActor, so thread safety is fine), e.g. private static let iso8601Fractional / iso8601Plain / dayFormatter, and reuse them.


Low Severity

  • [BUG]

  • Severity: [LOW]

  • File: BetaFeedbackModels.swift (line 19)

  • Description: BetaFeedbackScreenshot.id falls back to "\(width)x\(height)" when url is nil, producing duplicate identities for multiple URL-less attachments of the same size. It's harmless today because the only consumer enumerates by offset, but the Identifiable contract is misleading and will silently break diffing if used elsewhere.

  • Suggestion: Either drop Identifiable conformance (the detail view doesn't use it) or note the collision caveat in a comment.

  • [BUG]

  • Severity: [LOW]

  • File: SideBarView/DetailView/Reviews/ReviewsViewModel.swift (new pagination-start hunk, ~line 1138)

  • Description: appStoreVersionsFetchLive = false is immediately overwritten by = true two lines later — dead statement left over from the old flow. It also makes the flag's lifecycle harder to reason about.

  • Suggestion: Remove the = false line; set it once to true.

  • [BEST PRACTICE]

  • Severity: [LOW]

  • File: PricingViewModel.swift (~line 87)

  • Description: var tomorrow: Date { Calendar.current.date(byAdding:...)! } force-unwraps. Practically never nil, but it's a write-path-adjacent computed property and easy to make safe.

  • Suggestion: ?? Calendar.current.startOfDay(for: now()).addingTimeInterval(86_400).

  • [IMPROVEMENT]

  • Severity: [LOW]

  • File: BetaFeedbackModels.swift (decode, lines ~140–144) and PricingModels.swift (PricingDocument.nextCursor, lines ~46–49)

  • Description: Identical opaque-cursor extraction (URLComponents → queryItems → cursor) is implemented twice. Both handle percent-decoding correctly today; a future change to one copy could silently diverge the other.

  • Suggestion: Extract a small shared helper, e.g. func cursorParameter(from nextLink: String?) -> String?, and reuse it.

  • [PERFORMANCE]

  • Severity: [LOW]

  • File: BetaFeedbackViewModel.swift (live.screenshot) and BetaFeedbackView.swift (onChange, ~line 78)

  • Description: (a) A new ephemeral URLSession is created per screenshot and there's no cache, so re-selecting the same row re-downloads the image within a session. (b) .onChange(of: model.filteredItems.map(\.id)) builds an array of every visible ID on every body evaluation, which grows with paginated history.

  • Suggestion: (a) Share one ephemeral session (e.g. a lazily created property on the API struct's storage) or a small in-memory cache keyed by URL string. (b) Compare only whether selectedID is still contained rather than materializing the full ID array, or debounce/derive the check from filteredItems.count.

  • [BEST PRACTICE]

  • Severity: [LOW]

  • File: Shipyard/ReviewSubmissionUITestHost.swift (lines 1–100)

  • Description: PricingSampleServer and BetaFeedbackAPI.sample (including the NSImage drawing code) live unguarded in the app target beside the screenshot-safety machinery, and are also consumed by unit tests via @testable. If this file is compiled into Release builds, that's a fair amount of dead sample-data code shipping with the app.

  • Suggestion: Verify this file is excluded from Release (target membership or wrap in #if DEBUG), consistent with how the safety gates are gated.

  • [IMPROVEMENT]

  • Severity: [LOW]

  • File: PricingViewModel.swift (scheduleChange, lines ~230–300)

  • Description: Two acknowledged-but-worth-commenting properties of the write path: (1) the "re-read schedule and compare rows" check has an inherent TOCTOU window between the validation reads and the POST (no server ETag available), and (2) posted = true is set before the POST is issued, intentionally treating send failures as uncertain. Both are the conservative/correct choices for a money-affecting operation, but only the tests reveal that intent.

  • Suggestion: Add brief comments at posted = true and the freshRows == oldRows guard stating why the conservative branch is deliberate, so future refactors don't "optimize" it away.

  • [BEST PRACTICE]

  • Severity: [LOW]

  • File: BetaFeedbackModels.swift (lines ~121, 152)

  • Description: URLError(.cannotParseResponse) is used for semantic validation failures (wrong resource type). When surfaced through FriendlyErrorMessage, users get a generic network-flavored message for what is really an unexpected-response-shape problem.

  • Suggestion: Introduce a small domain error (like you did with PricingError.invalidResponse) and map it in errorMessage for consistency with the pricing flow.


What looks good

  • Stale-response protection via generation/token/epoch checks in both view models, with dedicated tests for late responses after context switches.
  • The uncertain-write handling in scheduleChange (pendingChange + needsReload + reconciliation against the manual-prices list) is well thought out and well tested.
  • Security hygiene on attachments: HTTPS-only, rejection of userinfo URLs, ephemeral session, no cookies/cache/JWT, ephemeral cursor extracted rather than following links.next wholesale.
  • Pagination guards against repeated cursors (infinite-loop protection) in both feedback and pricing loaders.
  • Cache semantics on App Store versions (shared in-flight request, stale-while-revalidate, force bypass, tests for each) are clean.
  • Good accessibility identifiers and traits added alongside the UI tests.

No blocking issues — the medium items (selection reset on refresh, unbounded screenshot download, formatter churn) are worth addressing but the PR is otherwise in great shape.


Automated review by Ollama Cloud. The diff is untrusted input; findings may be inaccurate. If this review seems wrong, please provide feedback.

Share screenshot and preview data across App Info and the media manager. Show Apple delivery states, preserve device selection, and reconcile interrupted reservations before retrying uploads.
@NayanBhut NayanBhut changed the title Add TestFlight feedback, pricing tools, and version preloading Expand Shipyard release tools and submission diagnostics Nov 7, 2026
@NayanBhut NayanBhut closed this Nov 10, 2026
@NayanBhut
NayanBhut deleted the codex/fix-locale-selection branch November 10, 2026 16:38
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