Repository navigation
feat(push): fetch notification display data from v2 - #394
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
There was a problem hiding this comment.
Quick104 has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Code review summaryReviewed head: Process: an adversarial review of this PR's diff with each candidate finding independently verified before any fix, a simplify pass for medium and larger PRs, and a whole-stack review across contract conformance, authority and failure handling, data integrity, user-visible behavior and cross-PR integration. Verified findings: none. Validation: this branch builds on its own for iOS, tvOS and macOS, and its focused tests passed. The completed stack passed the full iOS suite (1981 tests) and tvOS suite (1792 tests) with 0 failures, the macOS build and the v1 path guard. The final stack was also exercised on iOS and tvOS simulators against a v1/v2 bridge server: sign-in (password and QR), restore, browse, search, detail, favorites and watchlist, playback (direct play, transcode, subtitles, stop), audiobooks, downloads with offline playback, settings, requests, profiles, push registration and diagnostics. Server logs showed no Remaining: no open verified findings. Merge in stack order. Mergeability: 8/10 — conditional. The approach holds up and every verified finding is fixed. Conditions: this PR's CI must pass (it was pending at review time), and the owner still plans a physical-device check of the completed stack. Review by Claude Opus 5.5 ( |
f00649d to
b5c3966
Compare
5f61261 to
17c0244
Compare
The NotificationService extension still fetched rich notification
content from GET /api/v1/notifications/push/apple/display/{delivery_id}.
The URL was built from path components, so a literal /api/v1 search
missed it.
The extension now reads GET /api/v2/notifications/push/apple/display/
{delivery_id}. The response shape, headers and credentials are unchanged:
the server guards both routes with the same display-token middleware, so
display tokens minted before this version keep working, and the 401/403
fallback to the mirrored access token still applies. The extension keeps
its own URLSession because APIv2Client is not linked into it. New stub
tests pin the v2 path, headers, the access-token retry after a rejected
display token, and a 404 problem that is not retried.
Stack-PR: W5-U
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
b5c3966 to
1888b11
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
The iOS NotificationService extension now fetches rich notification content from
GET /api/v2/notifications/push/apple/display/{delivery_id}instead of the v1 route.Problem
When a push arrives, the NotificationService extension fetches the title, body, thread and deep link from
GET /api/v1/notifications/push/apple/display/{delivery_id}.ApplePushDisplayWire.displayURLbuilds that URL from path components ("api","v1", ...), so a literal/api/v1search does not find it (inventory rows 129, 132 and 136).Solution
ApplePushDisplayWire.displayURLbuilds the v2 path. The request itself stays the same: the sameAuthorization: Bearercredential (display token first, mirrored access token second),X-Profile-Id, optionalX-Profile-Token, andAccept: application/json.NotificationPushDisplayschema (delivery_id,title,categoryandurlrequired;bodyandthread_idoptional). The server fixturenotification_apple_push_display.jsondecodes without changes.URLSessionwith a 4-second budget.APIv2Client,HTTPClientandTokenStoreare not linked into the extension target (project.ymlSiloNotificationServicesources), so it does not use the shared client. v2 returnsapplication/problem+jsonfor errors, but the extension only reads the status code. That keeps the 401/403 access-token fallback working.84ed9e596, both the v1 route and the v2 operation runRequireApplePushDisplayAuth(internal/api/router.godisplayMiddlewares,internal/apiv2/notification_inbox.go). Both routes accept the sameapple_push_displaytoken type (internal/auth/jwt.go). A token from the old v1 registration therefore works on the v2 route. This answers plan question S9 from source, not from a live server.This is a read with no mutation, so there is no failure-outcome table. The failure behavior is unchanged: any error, including a timeout, leaves the generic APNs content in place.
Validation
SiloNotificationServiceextension), tvOS and macOS builds pass on this branch.ApplePushRegistrationTestsandApplePushOrderedRegistrationTests, 33 tests, 0 failures. Two new stub tests:testDisplayFetchReadsV2AndRetriesARejectedDisplayTokenWithTheAccessToken: the display token gets a 401 problem, and the client retries once with the access token. Both requests use the v2 path with the same profile headers, and the response body is the server fixture's.testDisplayFetchSurfacesANotFoundProblemWithoutRetrying: a 404 problem throwsbadStatus(404)after exactly one request.testNotificationDisplayEndpointURLAppendsDeliveryIDasserts the v2 URL.#if os(iOS), andApplePushRegistrationTests.swiftis excluded fromSiloTVTests), so tvOS has no tests to run.scripts/ci/check-no-api-v1.shpasses.Risks and follow-ups
84ed9e596.scripts/sync-apiv2-fixtures.sh. Vendoring it would changeSELECTED,SOURCEandindex.json, which other lanes also edit. A later fixture sync can move it intoSELECTED.AI disclosure
Code and description written by Claude Opus 5.5 (
claude-opus-5-5) agents in Claude Code (T3 Code), orchestrated by a Claude Code workflow.Part 46 of 50 in the Apple API v2 stack. Base:
apiv2-stack/45-apple-push-registration-v2. Merge in order from the bottom of the stack. The plan and full index are in PR 01.🤖 Generated with Claude Code