Skip to content

Fix App Store review submission status and cancellation - #34

Merged
NayanBhut merged 29 commits into
mainfrom
NayanBhut/UI-Update
Oct 8, 2026
Merged

NayanBhut merged 29 commits into
mainfrom
NayanBhut/UI-Update

Conversation

@NayanBhut

Copy link
Copy Markdown
Owner

📋 PR Description

Fixes App Store review-submission state handling so Shipyard shows immediate progress after submit, refreshes the exact submitted version, and safely cancels only the intended version.

What changed?

Review submission safety

  • Load submissions from GET /v1/apps/{id}/reviewSubmissions with appStoreVersionForReview and match cancellation by exact version ID instead of platform.
  • Treat READY_FOR_REVIEW as a pending, metadata-locked state and expose “Remove from Review” only when that exact version has a cancellable submission.
  • Centralize post-cancel refreshes so cancellation from either Release or Reviews updates both the version and submission lists.
  • Clear only the matching post-submit polling epoch after cancellation, preventing Save and Submit from becoming stranded behind “Check Again.”

Post-submit feedback

  • Add a bounded, cancellable ReviewStatusSyncState poll after successful submission.
  • Show “Updating status…” while App Store Connect catches up, block duplicate submission, and offer “Check Again” when propagation takes longer than the automatic window.
  • Reset polling correctly on app/team changes and ignore superseded task generations.

UI and support fixes

  • Open Apple’s expedited-review request form from the release action.
  • Move toast notifications in from the trailing edge.
  • Correct demo-password dirty-state comparison.
  • Report missing/unreadable CSR and device CSV files as unreadable rather than oversized, and update UDID fixtures to valid formats.

Tests

  • Added JSON:API coverage for exact-version submission matching and items-only submissions.
  • Added review-status sync, settle, cancellation matching, state-label, and editability coverage.
  • Full macOS XCTest suite passes: 111/111.

Test Scenarios Covered

  • New feature added
  • Bug fix
  • UI changes
  • Swift build passes
  • Ollama Cloud PR Review passes

Ollama Cloud Review

The verified medium finding from the previous closed PR—canceling from Reviews while post-submit polling was active—has been fixed with version-scoped teardown plus a full post-write refresh. Low-severity polish findings were left unchanged unless directly related to correctness.

Checklist

  • Code compiles and builds successfully
  • No breaking changes
  • Self-reviewed my code

🤖 Automated Review Notice

This PR triggers an automated Ollama Cloud review using kimi-k3:cloud.
The review posts as a comment on this PR and is updated in place on every push.

  • Add [skip-review] to your PR title to skip the LLM review
  • Add [smoke-test] to your PR title for a quick connectivity check only

Replace the onboarding sheet with the Figma Launch Assistant flow:
full-window No Teams Connected starting page (sidebar hidden when no
team), Step 2 credentials, Step 3 private key, Step 4 validation with
Apps-found count. Reuses the existing JWT/.p8/Keychain logic; adds
Figma-exported PNG icons with light/dark variants.
Replace the post-auth window with the Shipyard shell: nav sidebar
(team switch/add/remove, monitoring badge, settings), Apps/Builds/
Devices/Certificates/Bundle IDs/Profiles/Users tables, full-screen
build detail (notes editor, compliance, beta groups, inspector),
TestFlight localizations browser, per-app area with App Info metadata
editor, and cursor-drained tester lists. Reuses existing view models
and writes; Figma PNG glyphs throughout.

Fixes App Info prefill on first entry: versions were requested via
the id-only load that no-ops until another screen sets the current
app, so the form had no version context until a tab switch. Loads
via load(app:) now, seeds drafts synchronously on open, keeps typing
across remounts, and adds manual reload preserving dirty fields.
…bundle, certificate sheets

- Invite Users and Invite Tester sheets match Figma modals; tester
  invite assigns all checked groups in one POST
- Revoke certificate uses the Figma warning dialog with PNG art
- Profile creation is a 6-step Figma wizard; register device, bundle
  ID and certificate are Figma create sheets opened as modals
- Confirmations on all destructive actions (delete, remove, disable,
  expire, revoke) and on build assign, which may trigger review
- New Release tab in app detail: version status card, readiness
  checklist (build validity, locale metadata gaps, copyright),
  submit-for-review behind confirmation, manual-steps handoff rows
- Shared FriendlyErrorMessage translator: offline/DNS/timeout, 401
  key rejection and 5xx map to actionable copy instead of raw
  system strings across all lists and forms
- Release tab rebuilt to Figma 76:31086/76:33999: version heading,
  Overview/All Versions/Resolution Center/Builds feature tabs, version
  chips, editable form (version string, per-locale What's New, build
  card, release type + date, phased release), inspector rail and
  missing-items/ready action bar driving Save + Submit for Review
- Choose Build sheet per Figma 76:33033 over all platform builds with
  processing/mismatch rows unavailable and attach behind the button
- ReviewsViewModel: candidate builds fetch, What's New save, optional
  versionString on release-settings PATCH
- allVersions no longer reads shownVersion (shownVersion reads
  allVersions) — that cycle overflowed the stack on appear
- saveReleaseSettings merges the previous build + localizations
  forward: the PATCH response has attributes only, and replacing the
  model outright made Save visibly detach the build
- N1 All Versions list (search, status filter, New Version sheet),
  N2/N3/N4 empty/loading/error states
- Prepare form (01/03/C2) with per-locale What's New, Choose Build
  sheet, release settings, phased toggle, and real appStoreReviewDetails
  editing (load-or-create, diff PATCH)
- Status screens 05/06/07/09/09A/R1/R2, locked states, inspector,
  per-state action bars, toasts, submit/cancel/release confirmations
- Robustness: pre-save server-state refetch, bounded 409 retry with
  field-level errors, fetch liveness so dropped loads can't strand the
  spinner, stuck-loader retry, sub-fetch error affordances
- Window opens at 1280x800 with overflow clamp for restored frames
- Hang: share ISO8601 formatters, replace sorted().first with single-pass
  max, memoize versionCaseState, compute allVersions once per body and
  hoist per-row submission lookups out of n1Table
- Layout: TopPinnedScrollView pins short state screens (overview,
  resolution, builds, prepare, N1 list) to the top instead of floating
  centered; Resolution Center tabs auto-select a version from the list
- Window: clamp also recentres offscreen origins, not just width
- A11y: team rows expose label + default action
- Version chips render in a fixed-height horizontal scroll strip instead
  of one overflowing HStack; chip taps stay on the current tab
- featureTabs padding lives at call sites so list tabs align with the
  title instead of double-padding to 48pt
- Certificates status uses the Profiles red/green dot language
- Certificate/profile create sheets swap to a success step offering
  the .cer/.mobileprovision download (save panel + atomic write)
  instead of dismissing; panel cancel is a no-op
- Row context menus gain Download: single GET for the content
  attribute, base64 decode, per-item in-flight guards
- Models gain certificateContent/profileContent (GET-single only)
- Sandbox User Selected Files readonly -> readwrite (Debug+Release)
  so signed builds can display save panels
Remove 11 unreferenced legacy views (SideBarView, DetailView,
VersionChip, BetaGroupView, Reports, legacy AppInfo, BuildDetails,
BuildRow, Spinner, OnBoarding) plus 13 dead structs in ResourcesView.
Live helpers extracted to Helper/BuildDisplaySupport.swift, InfoCard
moved to ReviewsView. Screenshots manager ported to ShipyardAppInfoView
reusing DetailViewModel's pipeline; a11y hints on app/build rows.
Device detail with rename, enable/disable confirms + success, dependent
profiles via include hydration, last-sync timestamps, empty state with
CSV import, Open Profile jump. Fixes PATCH null-body encoding.
Invite form adopts the Figma role checkboxes, app-access radios with the
shared Choose Apps sheet, restored provisioning toggle, and a pending-grant
summary. Pending invitations get their own lane with inspector, resend and
cancel sheets, and expirationDate recency sort (no sent-date in the API).
Edit user PATCHes roles, scope and provisioning with omit-nil encoding;
Account Holder renders protected read-only; remove uses email-confirm.
Stale-cache error state keeps rows with editing disabled. Resend preserves
app scope via include=visibleApps hydration; users/invitations fetches
include visibleApps for scope labels.
The 114-4499 invite flow is a full window, not a sheet: new
InviteUserDetailView with back navigation, identity fields, role/access
editor, summary and action bar; sending returns to the Pending lane.
Deletes the sheet-based InviteUserForm. Scope picker sits flush leading.
…lity

Profile detail with dependency inspector, jump links, signing-chain
private-key check, and invalid/expired banners; delete-confirm sheet
with type-name guard; regenerate wizard (compatible cert picker,
device picks, delete-and-recreate review, result with download);
created sheet gains Install for Xcode plus install-result sheet with
Reveal. List adds Type/Status filters, Bundle ID column, and derived
Active/Expired/Invalid status. Wizard uses platform+kind type step,
kind/platform/expiry certificate eligibility, eligible-only devices
with select-all, App Store skip branch, and blocks empty device sets
for dev/adhoc types.
ReleaseTabView never remounts when tapping another app on the same tab,
and had no onChange(app.id) — the old app's versions, selection and
drafts stuck around and writes could hit the wrong app. Reset view
state and reload on app-id change, mirroring App Info's boot(). A plain
struct app is correct (@ObservedObject requires a class).
Hide Apple Pay, Pass Type ID, Identity Access and Developer ID
certificates from the create wizard — they can't be embedded in
profiles. Add Select All/Clear to the wizard certificate step and to
the regenerate certificate/device pickers, and switch regenerate to
multi-select certificates. Show a loading state on the profile detail
until the hydrated fetch returns. Pad the cramped wizard step
headers.
Fixes from a 29-item static sweep plus live-flow checks, each verified
against current code before changing anything.

ASN.1 hardening: readLength() now returns an optional and every
toASN1Element() call site unwraps it, so malformed .p8 input throws
instead of trapping on an out-of-bounds read. The sequence loop also
bails on a zero-length child so a malformed child can't spin forever.
Covered by testToECKeyDataGarbageThrowsNotTraps and
testToRawSignatureShortSequenceThrows.

Expired builds: an expired VALID build read "Ready to Test" in both the
builds table and the build detail pill. Expiry now wins over
processingState in BuildDisplaySupport order.

Build pagination: a fresh fetch kept the previous version's cursor/meta,
so a version switch paged the old version's builds. Now cleared on every
non-paginating fetch. A failed page fetch also kept the list intact but
left the footer spinner running forever — it now raises
buildsPaginationFailed and the footer offers Retry.

Search epochs: a search-refresh response merged already-loaded apps
through matchesSearch, which reads the *current* term. During the 500 ms
debounce that filtered the old query's rows by the new term while
meta/cursor said otherwise, breaking the cursor epoch. The merge now
uses the request-time term.

Release notes: the editor now clamps to Apple's 4000-char cap so Save
stays reachable instead of silently no-op'ing. Locale completeness
counts only saved, non-whitespace text and ignores temp drafts, so an
empty staged locale no longer shows complete. Tapping a locale staged
an empty entry that survived as a phantom; stages are dropped on
navigation rather than on sync (dropping them in syncDrafts removed
them the instant staging mutated the locale list). Switching locales in
ReleasePrepareView silently discarded typed What's New — the Picker
now holds the target until the user answers the confirmation, and
commitLocaleSwitch is the single place a switch is applied.

Scheduled releases were unconditionally dirty, so every scheduled
version re-PATCHed on each Save and never greyed out. Now compared
against the server's parsed earliestReleaseDate (61 s granularity to
match the DatePicker).

WhatsNewCard derived its title locale at each of five call sites while
the body preferred the primary locale, so the heading could name German
over English text on four screens. The card now takes a titlePrefix and
derives the locale from the same property the body renders.

Stale detail: switching or deleting a team left the previous team's app,
build and review context mounted, so its notes editor stayed visible.
ShipyardShell now clears it.

403 handling: beta-group writes (invite, add/remove tester, assign
build) and release-note saves surfaced raw server detail while group CRUD
and app-info writes already added a role hint. All write paths now route
through the same Admin / App Manager hint; 409 passes through untouched
because it already names the blocking state.

Certificate/profile creation: prependCertificate/prependProfile
discarded the server-confirmed model when the list wasn't loaded and
just refetched. The create form then had no success step — and since the
CSR's private key is consumed by the POST, the .cer was unreachable. Both
now seed the list with the created model.

External review: a decode failure reported WAITING_FOR_REVIEW when
nothing was submitted, and a non-404 fetch error silently became
UNKNOWN. Both now surface the real error. Review replies also reported
failure when the posted reply simply wasn't in the loaded page.

App Info: inline URL validation only checked the http(s) prefix, so text
the field accepted could still fail on Save; both now require a full URL
with a host. A failed Save gate returned silently while leaving the
button enabled — it now shows the error. The release versions loading
view no longer keeps a stale "taking longer" banner after a successful
load.

README advertised builds-table Markdown/CSV export and an ExportManager
that don't exist on this branch; removed.
…/disable

Completes the Module 04 Bundle IDs flow against Figma 114-*, and fixes
two API contract bugs found by running it live.

Related-resource queries
GET /v1/bundleIds/{id}/profiles and .../bundleIdCapabilities rejected
limit with PARAMETER_ERROR.ILLEGAL ("This relationship does not support
this parameter"), even though Apple's published spec still documents
it. Both are to-many-related routes, so all three call sites now send
fields[...] only and drop the 20-page cap-and-fail loops, along with
the two "more profiles than can be listed at once" messages that no
longer describe reality. fetchApps is untouched: /v1/apps is a
collection and does accept limit.

GET /v1/bundleIds/{id}/profiles also returns resources with no
relationships object at all, which ProfileModel cannot decode — its
three non-optional @ResourceRelationship properties each need an absent
key, surfacing as "The data couldn't be read because it is missing".
Added BundleIdProfileResource for that route and widened it into
ProfileModel via asProfileModel(), so the detail table is unchanged.
Corrected the ProfileModel comment that claimed every list response
carries linkage; it does not, and the new test pins both directions.

Capability enable
POST /v1/bundleIdCapabilities via enableCapability, completing the
enable half of enable/disable. The create body must carry
relationships.bundleId — the one write in this module that cannot key
off path like createBundleId/disableCapability. The api-evangelist
mirror omits this endpoint entirely, so it was verified against
Apple's "Enable a capability" reference (201 Created). The new
BundleIDEnableCapabilitySheet offers only types not already enabled,
since enabling a duplicate is an error rather than an idempotent no-op,
and closes only on success so failures stay visible with the picker
intact. This sheet has no Figma node yet and mirrors the disable
sheet's structure.

Register flow
Registering a Bundle ID now surfaces the created resource, so the form
confirms with status, a property table, "Create Profile…" (stepping
sideways rather than stacking a second sheet) and "Open Bundle ID",
which deep-links into the new detail. Wildcard identifiers derive from
a trailing .* only, never from seedId — the detail heading previously
inferred wildcard from seedId and could mislabel an identifier. Both
identifier radios now stay on screen: 114-2239 shows the wildcard
variant with wildcard preselected, but hiding Explicit made it a
one-way door. Loading uses a status banner plus skeleton rows, and the
empty state carries Figma guidance and actions.

Tests
Related-route param sets are named constants so the no-limit/no-cursor
rule is assertable without credentials. Coverage added for relationship
decoding (asserting ProfileModel throws on the same payload, so the
models can't be silently merged), the enable body shape, the 27-value
CapabilityType round-trip, and identifier-kind derivation.

Validation: macOS build, ValidationTests (excluding the pre-existing
testLoadCSRMissingFile failure on clean HEAD), plutil -lint.

Not verified: neither endpoint was exercised live (no credentials), and
the enable sheet is unreviewed against design.
Improve App Store version navigation, localized submission metadata, build selection, loading feedback, and team-scoped refresh behavior.

Expand certificates, identifiers, profiles, users, devices, screenshots, toasts, app icon assets, tests, and live-flow documentation.
Add monitoring, review-response, role-aware navigation, and bulk resource workflows. Improve App Info state handling, certificate/profile guidance, documentation, and toast behavior. Harden keychain/network privacy and enable hardened runtime plus the privacy manifest for distribution.
# Conflicts:
#	App Store Tests/ValidationTests.swift
#	Helper/ShipyardToast.swift
#	Model/JSONAPIModels/ResourceModels.swift
#	Shipyard/ReleaseTabView.swift
#	SideBarView/DetailView/Reviews/ReviewsViewModel.swift
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

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

Review Summary

This PR adds a bounded post-submit "status sync" poll, exact version-matched submission cancellation (fixing the dangerous platform-based match), READY_FOR_REVIEW support, and better file-loading error messages. Overall quality is high — task cancellation, generations, and retain cycles are handled carefully. Findings below are all low-severity polish items; no blockers.


  • [IMPROVEMENT]

  • Severity: [MEDIUM]

  • File: ReviewsViewModel.swift (canSubmitForReview ~line 788, submitForReview ~line 1905)

  • Description: The guard !reviewStatusSyncState.isActive blocks submissions for any version while a sync for one version is active. Since sync state is already version-scoped (ReviewStatusSyncState.syncing(versionId:)), an app submitting both an iOS and a macOS version (a legitimate flow — submissions are platform-scoped) is blocked for up to ~20 seconds for no reason.

  • Suggestion: Scope the guard to the specific version, e.g. !reviewStatusSyncState.belongs(to: versionId) in submitForReview, and similarly in canSubmitForReview using submissionVersion?.id.

  • [UI]

  • Severity: [LOW]

  • File: ReleaseTabView.swift (prepareActionBar, ~line 792)

  • Description: While reviewStatusSyncing or reviewStatusDelayed is active, the entire Save button is replaced by the spinner / Retry+Dismiss controls. If the user had unsaved edits when they submitted (or edits during a .delayed period after dismiss is possible elsewhere), they cannot save until the sync resolves. The delayed state can persist indefinitely until the user acts.

  • Suggestion: Consider rendering the Save button alongside "Check Again"/"Dismiss" in the delayed branch (guarded by canEditShown && isDirty), or call out in actionBarText that saving is temporarily unavailable.

  • [IMPROVEMENT]

  • Severity: [LOW]

  • File: ResourceModels.swift (lines ~414–421 and ~662–669)

  • Description: Both loaders now fold the fileSize > 0 check into the .unreadable branch. A genuinely empty but readable CSV/CSR file now reports "unreadable," which is misleading — the file was read fine, it just contains nothing. (Still a big improvement over the old behavior, where it was misreported as "too large.")

  • Suggestion: Either allow empty files through to the parser (which will naturally yield zero rows), or add a dedicated .empty error case with an accurate message shown by the form.

  • [BEST PRACTICE]

  • Severity: [LOW]

  • File: ShipyardToast.swift (line 252)

  • Description: The toast transition change (.move(edge: .bottom) → .move(edge: .trailing)) is unrelated to the review-status-sync work in this PR. Drive-by UI tweaks make review and potential reverts harder.

  • Suggestion: Split this into its own PR/commit, or at minimum call it out in the PR description so QA knows to verify toast animation direction.

  • [BEST PRACTICE]

  • Severity: [LOW]

  • File: ReviewsViewModel.swift (pollReviewStatus error catch, ~line 2085)

  • Description: reviewsLogger.error("Failed to refresh review status: \(error.localizedDescription)") interpolates without an explicit privacy: annotation, so the description is redacted (<private>) in release logs — making this new polling path hard to diagnose in the field. Nearby logging in this file uses explicit privacy: .public.

  • Suggestion: Use reviewsLogger.error("Failed to refresh review status: \(error.localizedDescription, privacy: .public)") for consistency (the description contains no user data).

  • [IMPROVEMENT]

  • Severity: [LOW]

  • File: ReviewsViewModel.swift (pollReviewStatus; also dismissReviewStatusSync)

  • Description: Two minor items: (a) the polling loop itself (attempt counting, exhausting into .delayed, the 404 early-exit, generation bail-outs) has no test coverage — only the pure reviewStatusDidSettle is tested; injecting the sleep/clock would make this testable. (b) dismissReviewStatusSync reuses clearReviewStatusSync(afterCancellingVersionId:), whose name now describes only one of its two call sites.

  • Suggestion: (a) Extract the interval/attempts behind a small injectable clock or make the poll loop take a sleep: (UInt64) async throws -> Void parameter and add unit tests for the delayed/404 paths. (b) Rename the cleanup helper to something neutral like clearReviewStatusSync(forVersionId:).


What looks good 👍

  • The switch from platform-based to exact-version matching in cancellableSubmission(for:) correctly addresses a real data-loss risk (cancelling an unrelated items-only submission), and the test covers the exact-match, wrong-version, and nil-relationship cases.
  • Task lifecycle hygiene is solid: [weak self] capture, generation checks on every resumption point, defer for task cleanup that correctly ignores stale generations, cancellation in deinit and both reset paths.
  • The READY_FOR_REVIEW handling is consistent everywhere it matters: pending states, non-editable states, status label, pending-only case-state test, and the guarded settle logic.
  • The delayed/retry/dismiss escape hatch with the 404 early-exit is a thoughtful recovery design.

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

@NayanBhut

Copy link
Copy Markdown
Owner Author

Round 1 triage:

  • FIXED: A second platform submission could replace the single active status poll. Submit is now blocked globally while a sync or delayed check is active.
  • FIXED: READY_FOR_REVIEW was shown as Waiting for Review and incorrectly ended polling. It now displays Ready for Review and polling continues until Apple reports a submitted state such as WAITING_FOR_REVIEW or IN_REVIEW.
  • FIXED: Persistent polling failures could trap release actions. A 404 now ends the stale check and refreshes versions; delayed checks also have a Dismiss recovery action.
  • FIXED: Per-version UI checks now use belongs(to:), save errors remain visible during sync, and the pre-save fetch uses the shared snapshot path.
  • FALSE POSITIVE: Task.sleep(nanoseconds:) does not produce a deprecation warning with this project target and the Xcode 26.2 SDK, so it was not changed.
  • DEFERRED: READY_FOR_REVIEW remains conservatively read-only. Apple documents that some fields are editable and others are not in this state; changing that safely requires field-level write rules rather than enabling every release field.

Verification: pbxproj lint passed, the exact CI build command succeeded, and the full macOS XCTest suite succeeded.

Commit: 7d32ec0

@NayanBhut
NayanBhut merged commit 5bb05ed into main Oct 8, 2026
3 checks 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.

2 participants