Premium Analytics: add Stats app notices endpoint - #49890
Conversation
Code Coverage SummaryThis PR did not change code coverage! That could be good or bad, depending on the situation. Everything covered before, and still is? Great! Nothing was covered before? Not so great. 🤷 |
|
@claude please review this PR. |
|
Claude finished @kangzj's task in 2m 8s —— View job PR Review: Stats app notices endpoint
Reviewed against the foundation branch ( A few suggestions, all minor/non-blocking: 1. Mutation uses the imported
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
aec8889 to
1c32960
Compare
|
Claude finished @kangzj's task in 1m 18s —— View job PR Re-Review: Stats app notices endpoint
Re-reviewed against the rebased base (
The local-route decision is still correct and matches Status of prior feedback (all still open, all non-blocking)None of the four earlier suggestions were addressed in the rebase — relisting with updated notes: 1. Mutation uses the Worth noting: there is existing precedent for importing the singleton — import { useMutation, useQueryClient } from '@tanstack/react-query';
export function useStatsAppNoticeMutation() {
const queryClient = useQueryClient();
return useMutation( {
mutationFn: ( data: StatsAppNoticeMutationParams ) => updateStatsAppNotice( data ),
onSuccess: () => {
queryClient.invalidateQueries( { queryKey: [ 'stats-app', 'notices' ] } );
},
} );
}2. The foundation's 3.
4. Mutation params loosely typed — If VerdictNothing blocking — the rebase is clean and the wiring is correct. The |
|
Addressing claude[bot]'s re-review (comment #4787361853): switched the notice mutation to |
|
@claude please re-review.\n\n |
|
Claude finished @kangzj's task in 42s —— View job PR Re-Review: Stats app notices endpoint
Re-reviewed against ✅ Prior feedback #1 is resolved
export function useStatsAppNoticeMutation() {
const queryClient = useQueryClient();
return useMutation( {
mutationFn: ( data: StatsAppNoticeMutationParams ) => updateStatsAppNotice( data ),
onSuccess: () => {
queryClient.invalidateQueries( { queryKey: [ 'stats-app', 'notices' ] } );
},
} );
}This is exactly the idiomatic react-query pattern and sets a good template for future mutations in the package. The Wiring re-verified
Remaining items (all non-blocking, fine to defer)
VerdictThe one change I'd most recommended (#1) is done and done cleanly. Nothing blocking remains — the rest are optional refinements that can reasonably wait for the notices response/request contract to firm up. LGTM. ✅ |
217f371 to
88e6a47
Compare
88e6a47 to
cd99f8b
Compare
Fixes #
Proposed changes
Related product discussion/links
Does this pull request change what data or activity we track or use?
No. This only adds typed client data/query integration for an existing Stats API endpoint.
Testing instructions