Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/76a7e532-d68e-4b0b-9194-62dd020d7ae3 Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Agent-Logs-Url: https://github.com/OpenKnots/okcode/sessions/76a7e532-d68e-4b0b-9194-62dd020d7ae3 Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix GitHub Actions job failure during iOS build
Harden local-notifications iOS patching for Capacitor 8 API drift in release builds
Apr 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
The iOS release job was failing because the post-
cap syncpatch no longer fully normalized@capacitor/local-notificationsSwift sources for the Capacitor APIs present in CI. This PR makes patching deterministic, version-aware, and fail-fast so CI does not proceed with partially patched plugin code.Patch script hardening (
scripts/patch-capacitor-local-notifications.ts)8.getArray(..., JSObject.self)/ optional-chain forms →getArray(..., []).compactMap(...)call.reject(...)paths → compatiblecall.unimplemented(...)paths used in this environment.Idempotency + maintainability
Capacitor/workflow scope
8in repo/lockfile; no dependency bump needed.cap sync ios) remains unchanged.Why
The failure mode was “patch appears to run, Xcode still compiles incompatible Swift.” The right fix is to make patching explicit and verifiable against the installed plugin version so mismatches fail immediately with actionable errors instead of surfacing later as Swift compile failures in the iOS job.
UI Changes
None.
Checklist
Original prompt
Implement the optimal and recommended fix for the failing GitHub Actions job in OpenKnots/okcode (run 24683396897, job 72187038780).
Context:
.github/workflows/release.ymlat commit033947daf1cfe7756cc574512944e9bde7c71752.node_modules/@capacitor/local-notifications/ios/Sources/LocalNotificationsPlugin/LocalNotificationsPlugin.swiftincluding:call.getArray("notifications")now requires a second parameter default value (getArray(_ key: String, _ defaultValue: Capacitor.JSArray) -> Capacitor.JSArray).?.used on non-optional return.CAPPluginCallhas no memberreject.call.getArray("notifications", JSObject.self)type mismatch.bun run patch:capacitor-local-notifications(scriptscripts/patch-capacitor-local-notifications.ts) before and afterbunx cap sync ios --deployment, but patch is not effective or out of date.Goal:
Recommended approach:
@capacitor/local-notificationswith@capacitor/core/@capacitor/ios(pin compatible versions in the appropriatepackage.jsonwithinapps/mobileand/or workspace root as needed). Update lockfile accordingly.scripts/patch-capacitor-local-notifications.tsto patch the current plugin source in a version-aware, idempotent way, and add verification so CI fails early if the expected patterns are not found or the patch didn’t apply.cap sync ios, and remove redundant patch step if unnecessary) while keeping behavior stable.Deliverables:
bun install --frozen-lockfilestill works in CI.Reference:
.github/workflows/release.yml(commit 033947d).LocalNotificationsPlugin.swiftaround lines 60, 61, 126, 164, 165, 204, 292, 605, 606.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The job is failing during the iOS build because the Swift sources inside
node_modules/@capacitor/local-notificationsno longer compile with the Capacitor API your build is using (Xcode 15.4 is just where it gets surfaced). The errors show an API mismatch:call.getArray("notifications")now requires a default value (getArray(_ key: String, _ defaultValue: JSArray) -> JSArray)call.getArray(...)returns a non-optionalJSArray, so?.compactMap(...)is invalidCAPPluginCallhas no memberreject(your Capacitor version expectscall.reject(...)to be replaced withcall.reject(<message>, <code?>, <error?>, <data?>)orcall.reject(...)is no longer available and you should be using the newer error APIs (varies by Capacitor major)The fix: stop compiling incompatible plugin code
You have already anticipated this in your workflow: the iOS job runs “Patch Capacitor local-notifications for Xcode 15”:
.github/workflows/release.ymllines 361-370 run:bun run patch:capacitor-local-notificationsbunx cap sync ios --deploymentBut the compilation errors prove the patch either:
Recommended solution (robust): pin compatible versions + regenerate the patch
Align Capacitor core and local-notifications to the same major version
@capacitor/core@capacitor/ios@capacitor/local-notificationsConcretely, pick one track:
@capacitor/local-notifications@6.x@capacitor/local-notifications@7.x@capacitor/*packages together.**Fix the patch script so it patches the *curre...
This pull request was created from Copilot chat.