Repository navigation
Add push subscription listing for authenticated users - #649
Merged
Merged
Conversation
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes in the authenticated subscription listing, its generated API schema, catalog mapping, and unit tests:
- Subscription query: Filters by user, sorts newest first, and returns transport, timestamp, ID, and endpoint hash without exposing push credentials.
- HTTP and catalog: Adds the authorized GET route and registers it on the notification surface.
- Coverage: Exercises user isolation, response fields, transport mapping, ordering, and authenticated dispatch.
GPT Sol | 𝕏
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.

Change
Add
GET api/notifications/subscriptionsfor the authenticated user. The response contains a newest firstitemslist withid,transport,createdAtUtc, and a lowercase SHA-256endpointHash, plusmaxfrom the existing subscription cap. It does not expose endpoints or keys.The route in
src/Orbit.Api/Controllers/NotificationController.csdispatches the query insrc/Orbit.Application/Notifications/Queries/GetPushSubscriptionsQuery.cs. Its validator lives insrc/Orbit.Application/Notifications/Validators/GetPushSubscriptionsQueryValidator.cs. The existing repository filters by user before mapping to a response DTO.src/Orbit.Api/openapi.jsonwas regenerated by the build. The action is registered in the notification read capability and app surface insrc/Orbit.Infrastructure/Services/AgentCatalogService.Capabilities.csandsrc/Orbit.Infrastructure/Services/AgentCatalogService.Surfaces.cs.Tests in
tests/Orbit.Application.Tests/Queries/Notifications/GetPushSubscriptionsQueryHandlerTests.cscover 0, 1, and 5 subscriptions, isolation from another user, sorting, hash output, transport mapping, and serialized field safety.tests/Orbit.Infrastructure.Tests/Controllers/NotificationControllerTests.cschecks dispatch with the authenticated user ID.Closes thomasluizon/orbit-tickets#915.
Assumptions
itemsfor the list, matching the existing notifications response, instead of asubscriptionsproperty.nativeand Web Push toweb, instead of exposing internal enum names.Test evidence
dotnet test tests/Orbit.Application.Tests --filter FullyQualifiedName~GetPushSubscriptionsQueryHandlerTests: 4 passed.dotnet test tests/Orbit.Infrastructure.Tests --filter FullyQualifiedName~NotificationControllerTests: 18 passed.env -u LANG LC_ALL=en_US.UTF-8 dotnet test: the existingAgentCatalogServiceTests.EveryControllerAction_IsMappedToTheCatalogfailed forNotificationController.GetSubscriptions; the catalog mapping was added and its focused rerun passed.env -u LANG LC_ALL=en_US.UTF-8 dotnet build Orbit.slnx -v:q: 0 errors.env -u LANG LC_ALL=en_US.UTF-8 dotnet test -v:q: 8,065 passed, 0 failed.