Skip to content

fix(tests): nonisolated deinit for MainActor back-deploy crash - #104

Merged
Pigbibi merged 2 commits into
mainfrom
fix/marketplace-mainactor-test-hygiene
Nov 13, 2026
Merged

Pigbibi merged 2 commits into
mainfrom
fix/marketplace-mainactor-test-hygiene

Conversation

@Pigbibi

@Pigbibi Pigbibi commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

改动内容

根治 MarketplaceViewModelTests 的 malloc 崩溃:在无自定义清理的 ViewModel / MockRepository 上补充 nonisolated deinit {},并保留同步释放回归探针与 Marketplace 源码护栏。

不改会怎样

在 SWIFT_DEFAULT_ACTOR_ISOLATION=MainActor + iOS 26.2 isolated-deinit back-deployment 下,同步构造/释放仍可能触发 malloc: pointer being freed was not allocated;仅把用例改 async 只是绕过。

怎么验证的

# 本机无完整 Xcode,做了 swiftc -parse
swiftc -parse GdeiAssistant-iOS/Features/Marketplace/ViewModels/MarketplaceViewModel.swift
swiftc -parse GdeiAssistant-iOSTests/Marketplace/MarketplaceViewModelTests.swift

# 完整 XCTest / Build Smoke 依赖 CI

检查清单

  • 上面列出的检查已通过,或有说明为什么没跑
  • 改动涉及的行为变化,已在同一次 PR 里更新对应文档
  • 没有提交真实账号、密码、验证码、Token、Cookie 或他人个人信息
  • 没有提交密钥、证书、local.properties 或环境配置文件

涉及隐私、权限或数据流的改动

不涉及。

关联 Issue

无。对应 untangle 剩余项「MarketplaceViewModelTests 崩溃排查」。

AI 辅助

Cursor(Composer)协助根因分析与批量补 nonisolated deinit。

风险

低。空 nonisolated deinit 与既有 ProfileViewModel / SessionState 修法一致;BindPhoneViewModel 等有真实清理逻辑的 deinit 未改。

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:40:01.290623Z c3082ca New commits
🔒 Security Review ✅ Completed 2026-11-13T15:41:31.060597Z c3082ca New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Pigbibi Pigbibi added owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. and removed owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. labels Nov 13, 2026
Pigbibi and others added 2 commits November 13, 2026 23:38
MarketplaceViewModelTests sync construction hit malloc on iOS 26.2
MainActor isolated-deinit back-deployment (swiftlang/swift#87316),
same class of bug as UserPreferences/ProfileViewModel. Empty
nonisolated deinit on ViewModels/MockRepositories is the root fix;
keep a sync release probe and source hygiene guard.

Co-authored-by: Cursor <cursoragent@cursor.com>
The deinit insertion landed inside the parameter list and broke the
simulator build; move it after the complete initializer.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Pigbibi
Pigbibi force-pushed the fix/marketplace-mainactor-test-hygiene branch from 534fc89 to c3082ca Compare November 13, 2026 15:38
@Pigbibi Pigbibi added owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. and removed owner-approved Owner approval for high-risk PRs. AI agents must never apply this label. labels Nov 13, 2026
@Pigbibi
Pigbibi merged commit f95f2e3 into main Nov 13, 2026
19 of 22 checks passed
@Pigbibi
Pigbibi deleted the fix/marketplace-mainactor-test-hygiene branch November 13, 2026 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

owner-approved Owner approval for high-risk PRs. AI agents must never apply this label.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant