Skip to content

API リファレンスの端末数と取り消しの配送先をプラン別の配送に合わせる - #112

Merged
bannzai merged 1 commit into
mainfrom
issue-107
Sep 24, 2026
Merged

bannzai merged 1 commit into
mainfrom
issue-107

Conversation

@bannzai

@bannzai bannzai commented Sep 23, 2026 •

Copy link
Copy Markdown
Owner

概要

#107 の完了条件のうち、#109 で残していた docs/api.md の Limits 表 (端末数) を、#108 で入ったプラン別の配送先に合わせた。あわせて、#109 で足した取り消しの保証範囲の 1 文を、#108 の取り消しの挙動 (取り消し時点のプランで配送先を決める) まで含む形に直した。

documents/PROJECT.md の更新と Alarmify/Localizable.xcstrings の未参照キーの削除は #109 でマージ済みのため、本 PR で #107 の完了条件がすべて揃う。

Closes #107

変更点

docs/api.md の Limits

  • 表の「Devices per account | 20 | 20」を「Devices that receive alarms | 1 (the first device registered) | All registered devices (up to 20)」に変えた
  • 表の下の「A plan-specific device limit is not enforced yet; both plans share the same cap of 20 registered devices.」を削除し、次の 2 点を書いた

根拠にした実装: firebase/functions/src/api/externalApi.ts の deliveryTargets (devices.slice(0, planLimits[plan].deliveryDevices))、firebase/functions/src/lib/plan.ts の deliveryDevices (無料 1 / Pro 上限なし)、firebase/functions/src/lib/store.ts の MAX_DEVICES_PER_USER = 20 と listDevices (登録順)。

docs/api.md の DELETE /v1/alarms/{id}

#109 で足した「取り消しは取り消し時点で登録されている端末へ届く」を、「取り消し時点でアラームを受け取る端末へ届く (Limits 参照)」に変え、解除されない例に「Pro の失効で受信しなくなった端末」を足した。#108 の DELETE は取り消し時点のプランで配送先を決めるため、Pro で登録したアラームを失効後に取り消すと 2 台目以降には届かない (#108 の PR body で「docs/api.md への明記は #107 の担当」とされていた挙動)。

検証

すべてこの worktree で実行した。

コマンド 結果 ログ
make build-ios ** BUILD SUCCEEDED **。: warning: / : error: の行は 0 件 tmp/build.log
make test ** TEST SUCCEEDED **。77 tests / 0 failures / 3 skipped (StoreKitConfigurationTests。iOS 26.5 の simulator runtime で StoreKit Testing が動かないため skip する既知の挙動)。: error: の行は 0 件。warning は 1 件で、xcodebuild の --- xcodebuild: WARNING: Using the first of multiple matching destinations: (テスト先の simulator が複数一致した時の実行環境の警告。コードのコンパイラ警告ではない) tmp/test.log
npm run build --prefix scripts/site 成功。生成された tmp/site/api.html に変更後の表の行が入っていることを確認 tmp/site-build.log
npm test --prefix scripts/site # pass 2 / # fail 0 tmp/site-test.log

画面に影響する変更ではない (API リファレンスの Markdown のみ) ため、シミュレータでのスクリーンショットは撮っていない。

本番の Functions のデプロイ (マージ前に実施済み)

docs/ は main へのマージで pages-deploy.yml が https://signalarm.app/ へ自動配信する一方、Functions のデプロイは手動のため、本 PR 作成時点の本番は #108 を含んでいなかった (alarmsApi の updateTime 2026-09-14T11:03:27Z、#108 のマージは 2026-09-23T03:35:16Z)。#107 の補足どおり実装より先にドキュメントを出さないよう、マージ前にデプロイした。

ADR

新しい意思決定は含まない (プラン別の端末数の決定は #90 のコメント、実装は #108)。

Codex ローカルレビュー

人間が確認

なし (マージ前の Functions デプロイは、ユーザーの依頼を受けて実施し上記で確認した)

セッション再開

cd /Users/bannzai/worktrees/bannzai/Alarmify/issue-107
claude --resume 83134381-d656-4ce9-9d41-d5661bf6cdff

変更内容

  • docs/api.md の Limits 表をプラン別の配送仕様に更新しました。無料プランでは最初に登録した端末 1 台に、Pro では登録済みの全端末(最大 20 台)にアラームを配送します。
  • 無料プランでは後から登録した端末もアカウントに登録されますが、アラームは受信しないことを追記しました。Pro 終了後は最初に登録した端末への配送に戻ります。
  • DELETE /v1/alarms/{id} の説明を更新しました。取り消しは、リクエスト時点でアラームを受信する端末に届きます。登録解除や Pro 終了で受信対象から外れた端末に残るアラームは解除されず、アプリから取り消す必要があります。

#108 でバックエンドがプラン別の配送先 (無料は最初に登録した 1 台、Pro は登録済みの全端末) を強制するようになったため、docs/api.md の Limits 表と取り消しの説明を実装に揃える。

- Limits 表の「Devices per account | 20 | 20」を、アラームを受け取る端末の行 (無料 1 台 / Pro 全端末・上限 20 台) に変えた
- 「A plan-specific device limit is not enforced yet」を削除し、無料では 2 台目以降が登録されたまま受信しないこと、Pro 失効時は最初の 1 台へ戻ることを書いた
- DELETE の取り消しは取り消し時点のプランの配送先へ届くため (#108)、登録を外した端末に加えて Pro 失効で受信しなくなった端末のアラームも解除されない旨を書いた
@coderabbitai

coderabbitai Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 9083b59f-931a-424d-b10e-1b35f05505e1

📥 Commits

Reviewing files that changed from the base of the PR and between d04cfdc and 2ab213f.

📒 Files selected for processing (1)
  • docs/api.md

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The API documentation now describes cancellation limits and plan-specific alarm delivery. Free delivery goes to the first registered iPhone. Pro delivery goes to all registered devices, up to 20.

Changes

API Documentation

Layer / File(s) Summary
Document delivery and cancellation rules
docs/api.md
Cancellation guidance explains that alarms on devices that stop receiving alarms after Pro ends remain active and must be cancelled in the app. The limits table and accompanying text distinguish Free delivery to the first registered iPhone from Pro delivery to all registered devices, up to 20.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Merge Risk: ⚪ Minimal · up to 2ab21

The API reference now distinguishes Free and Pro delivery and explains which devices cancellation can reach. The supplied backend behavior matches these descriptions, with no actionable merge risk remaining.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed #107 requires plan-specific device delivery and cancellation guidance in docs/api.md. The reviewed summary reports Free delivery to the first registered iPhone, Pro delivery to all registered device…
Out of Scope Changes check ✅ Passed The reviewed change is limited to three additions and three removals in docs/api.md. Each change documents the plan-specific delivery or cancellation behavior required by #107. No unrelated product …
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Title check ✅ Passed タイトルは、API リファレンスの端末数と取り消し配送先をプラン別配送に合わせて更新する主な変更を明確に示しています。
Description check ✅ Passed 説明にはテンプレートの「概要」「変更点」「人間が確認」の各セクションがあり、変更内容、検証結果、関連 issue、デプロイ確認を具体的に記載しています。
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the alarm list at dawn,
One iPhone gets Free; Pro sends alarms on.
Up to twenty devices hear the chime,
But old alarms need cancelling in time.
The rabbit hops off, its notes all aligned.

Comment @coderabbitai help to get the list of available commands.

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.

プラン別の端末数・取り消しの保証範囲・Sign in with Apple の方針をドキュメントと文言へ反映する

1 participant