Skip to content

fix(cli): show the extension hint in init apns only with an Appwrite push provider - #2173

Merged
ArnabChatterjee20k merged 3 commits into
mainfrom
fix/cli-apns-next-steps
Oct 29, 2026
Merged

ArnabChatterjee20k merged 3 commits into
mainfrom
fix/cli-apns-next-steps

Conversation

@ArnabChatterjee20k

@ArnabChatterjee20k ArnabChatterjee20k commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Issue / Description

Raised in appwrite/appwrite#14554 (comment).

At the end of init apns, apnsNextSteps() tells every user two things:

  • "Enable the Appwrite push provider", whenever the project has none enabled.
  • "Add a Notification Service Extension … and an App Group", always.

Both only apply when the Appwrite push provider carries the message and APNs only wakes the app. That provider is hidden in the Console (appwritePush: false on both profiles in console-profiles.ts), and a plain APNs provider sends the whole notification (Messaging.php). So most users are pointed at a provider they can't enable and an extension they don't need.

Solution

apnsNextSteps() prints nothing unless the project already has an enabled Appwrite push provider. In that case it prints only the extension hint. The "Enable the Appwrite push provider" hint is gone: the Console doesn't offer that provider, so the CLI shouldn't send people looking for it.

It still makes the same GET /messaging/providers call, so the request sequence on a rerun stays the same.

Tests

  • initpush_test.go
    • TestInitApnsAddsTheApplePlatform: with APNs alone, the output has no extension hint (this is the regression test).
    • TestInitApnsAsksForTheExtensionWithAnAppwritePushProvider: with an enabled Appwrite push provider, the extension hint is shown.
  • tests/e2e/languages/cli/main.go: initApns no longer expects either hint, and fails if the extension hint appears.

The tests were pushed in their own commits before the fix, so CI shows them failing on the old code (red), then passing with the fix (green).

Red: cli (console) on 6940d59, tests only (job)
--- FAIL: TestInitApnsAddsTheApplePlatform (0.01s)
    initpush_test.go:508: APNs alone asks for a Notification Service Extension:
        ℹ Info: Setting up APNs ...
        ✓ Success: Created provider APNs sandbox (com.example.app) ( id0 )
        ✓ Success: APNs (sandbox) is set up for com.example.app.
        ✓ Success: Added the Apple platform com.example.app to the project.
        ℹ Warning: Could not check the App ID for com.example.app: APNs key setup "appwrite" is not available: this build has none.
        ♥ Hint: APNs accepts pushes only for a bundle ID registered as an App ID with Push Notifications. Check it at https://developer.apple.com/account/resources/identifiers/list.
FAIL	github.com/repoowner/reponame/internal/cmd	2.789s

The first test-only commit (6b79355) never reached the tests: {{ in a Go map literal broke the Twig template. 6940d59 fixes the fixture.

Green: 7678f9c (the fix), all 60 checks pass, including cli (console) and Tests / CLIGo126.

🤖 Generated with Claude Code

@ghost

ghost commented Oct 29, 2026 •

Copy link
Copy Markdown

🟢 Tier S · Ready to merge

The CLI now shows the APNs Notification Service Extension hint only when the project has an enabled Appwrite push provider; APNs-only setups no longer receive that guidance. Unit and e2e coverage checks both the APNs-only and enabled-provider cases.

Latest changes: The latest commit gates the extension hint on finding an enabled Appwrite push provider and removes the obsolete prompt to enable that provider.

Verdict New comments Fixed Still open
✅ Approved 0 0 0
📂 Walkthrough · 3
File Change
templates/cli/internal/cmd/initpush.go Gates APNs extension guidance on an enabled Appwrite push provider.
templates/cli/internal/cmd/initpush_test.go Covers APNs-only output and the enabled-provider extension hint.
tests/e2e/languages/cli/main.go Rejects extension guidance in the APNs-only e2e setup.

Reviewed the commits since 6940d59 · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

ghost
ghost previously requested changes Oct 29, 2026

@ghost ghost 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.

🟡 Tier B · 1 blocking finding to address. Summary

@ghost ghost 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.

🟢 Tier S · Looks good to merge. Summary

@ghost
ghost dismissed their stale review October 29, 2026 15:05

The findings that requested changes are resolved. See the summary comment for what is still open.

@ArnabChatterjee20k
ArnabChatterjee20k merged commit 7bd3257 into main Oct 29, 2026
60 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.

1 participant