feat(libSceNpCppWebApi): track the UserProfile, ProfanityFilter and CommunicationRestrictionStatus parameter lifecycles as the module does #11639

Merged
AlexFigas merged 3 commits from upstream-pr/11639 into main 2026-10-29 23:50:15 +00:00
AlexFigas commented 2026-10-27 00:47:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlexFigas on 2026-10-27T00:47:33Z.


What

Five parameter classes returned 0 from initialize and terminate, which were declared without parameters, and their constructors left the object untouched:

  • UserProfile::V1::FriendsApi::ParameterToGetFriends
  • UserProfile::V1::PresenceApi::ParameterToGetBasicPresences
  • UserProfile::V1::BlocksApi::ParameterToGetBlockingUsers
  • ProfanityFilter::V2::ProfanityApi::ParameterToFilterProfanity
  • CommunicationRestrictionStatus::V3::CommunicationRestrictionStatusApi::ParameterToGetCommunicationRestrictionStatus

They now follow the module bundled with PPSA21564 (sce_module/libSceNpCppWebApi.prx, the library's own code), with the helpers from #11635.

Member Module Here
constructor (0x358250, 0x35ffb0, 0x353530, 0x1bbc70, 0x5a290) ParameterBase constructor zeroes +0, then +8 = 0 ConstructParameter
initialize null LibContext → 0x80553503; context not found → 0x80553502; +8 != 0 → 0x8055350f; then allocates and runs ParameterBase::initialize InitializeParameter, same checks in the same order
GetFriends (0x3582b0), GetBasicPresences (0x360010) initialize(LibContext*, const char*) String::copyFrom of the account ID(s); a null one gives 0x80553503 and undoes everything same result
GetBlockingUsers (0x353590) initialize(LibContext*), GetCommunicationRestrictionStatus (0x5a2f0) initialize(LibContext*, unsigned long) no further checks; the latter stores the account ID the account ID is not kept
FilterProfanity initialize(LibContext*, const char* locale, const char* serviceLabel, IntrusivePtr<WebApiFilterRequest>) (0x1bbcd0) copies both strings (0x80553503 for null), then an empty filter request returns 0x80553512 after undoing everything InitializeParameterWithBody
terminate (0x358460, 0x360190, 0x353670, 0x1bbff0, 0x5a3e0) +8 == 0 → 0x80553510; otherwise frees it, +8 = 0 TerminateParameter

No argument is kept, because only a request would read one, and requests fail with SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN here. Api.hpp now declares these members with their real parameters. The UserProfile/ProfanityFilter/CommunicationRestrictionStatus silent-stub debt entry now records what these five classes keep.

Tested

On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), rebased onto main 5bc84038c4, ctest --test-dir build -R np_cpp_web_api passes all 4 tests (2 runs).

  • guest_np_cpp_web_api_offline gains TestUserProfileParameterLifecycles. It runs each class through TestParameterLifecycle:

    • the constructor zeroes 0x10 bytes;
    • terminate returns 0x80553510 before initialize;
    • initialize returns 0x80553503 for a null context and 0x80553502 for a context that is not set up;
    • a missing argument leaves the parameter uninitialized: 0x80553503 for a null string, 0x80553512 for an empty WebApiFilterRequest;
    • initialize succeeds, a second call returns 0x8055350f, and terminate works once and again after a new initialize.
  • guest_np_cpp_web_api_signed_out used to call initialize and terminate with no arguments. Its request flows now:

    • set up a LibContext;
    • initialize each parameter through a small adapter with real arguments;
    • pass the parameter to terminate;
    • tear the context down.

    The rest of each flow is unchanged.

Also run:

  • python3 tools/check_conventions.py --base origin/main passes.
  • python3 tools/pr_overlap.py --branch feat/npcppwebapi-userprofile-parameter-lifecycles reported two overlaps:
    • #11235 (mine) at GuestNpCppWebApiSignedOut.cpp L116-117. It has merged, and this branch is rebased onto it: the flow keeps #11235's finish expectation (0x80553508) and this PR's terminate(parameter).
    • #11631 at docs/dev/debt/libSceNpCppWebApi.md L9. It adds BasicProfileApi::ParameterToGetPublicProfile to the list this PR rewrites. #11631 lands first, so this PR declares Depends on: #11631. Once it lands I'll rebase and keep that class in a "succeeds without storing state" sentence until it gets the same lifecycle.
  • The branch was stacked on #11636 so the test additions do not collide. #11635 and #11636 have merged, so only this PR's commit is left on top of main.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: #11631 (#11636 has merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5026856851 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11639). Originally posted by [AlexFigas](https://github.com/AlexFigas) on 2026-10-27T00:47:33Z. --- ### What Five parameter classes returned 0 from `initialize` and `terminate`, which were declared without parameters, and their constructors left the object untouched: - `UserProfile::V1::FriendsApi::ParameterToGetFriends` - `UserProfile::V1::PresenceApi::ParameterToGetBasicPresences` - `UserProfile::V1::BlocksApi::ParameterToGetBlockingUsers` - `ProfanityFilter::V2::ProfanityApi::ParameterToFilterProfanity` - `CommunicationRestrictionStatus::V3::CommunicationRestrictionStatusApi::ParameterToGetCommunicationRestrictionStatus` They now follow the module bundled with PPSA21564 (`sce_module/libSceNpCppWebApi.prx`, the library's own code), with the helpers from #11635. | Member | Module | Here | |---|---|---| | constructor (0x358250, 0x35ffb0, 0x353530, 0x1bbc70, 0x5a290) | `ParameterBase` constructor zeroes +0, then `+8 = 0` | `ConstructParameter` | | `initialize` | null `LibContext` → `0x80553503`; context not found → `0x80553502`; `+8 != 0` → `0x8055350f`; then allocates and runs `ParameterBase::initialize` | `InitializeParameter`, same checks in the same order | | `GetFriends` (0x3582b0), `GetBasicPresences` (0x360010) `initialize(LibContext*, const char*)` | `String::copyFrom` of the account ID(s); a null one gives `0x80553503` and undoes everything | same result | | `GetBlockingUsers` (0x353590) `initialize(LibContext*)`, `GetCommunicationRestrictionStatus` (0x5a2f0) `initialize(LibContext*, unsigned long)` | no further checks; the latter stores the account ID | the account ID is not kept | | `FilterProfanity` `initialize(LibContext*, const char* locale, const char* serviceLabel, IntrusivePtr<WebApiFilterRequest>)` (0x1bbcd0) | copies both strings (`0x80553503` for null), then an empty filter request returns `0x80553512` after undoing everything | `InitializeParameterWithBody` | | `terminate` (0x358460, 0x360190, 0x353670, 0x1bbff0, 0x5a3e0) | `+8 == 0` → `0x80553510`; otherwise frees it, `+8 = 0` | `TerminateParameter` | No argument is kept, because only a request would read one, and requests fail with `SCE_NP_WEBAPI_ERROR_NOT_SIGNED_IN` here. `Api.hpp` now declares these members with their real parameters. The UserProfile/ProfanityFilter/CommunicationRestrictionStatus silent-stub debt entry now records what these five classes keep. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), rebased onto `main` 5bc84038c4, `ctest --test-dir build -R np_cpp_web_api` passes all 4 tests (2 runs). - **`guest_np_cpp_web_api_offline`** gains `TestUserProfileParameterLifecycles`. It runs each class through `TestParameterLifecycle`: - the constructor zeroes 0x10 bytes; - `terminate` returns `0x80553510` before `initialize`; - `initialize` returns `0x80553503` for a null context and `0x80553502` for a context that is not set up; - a missing argument leaves the parameter uninitialized: `0x80553503` for a null string, `0x80553512` for an empty `WebApiFilterRequest`; - `initialize` succeeds, a second call returns `0x8055350f`, and `terminate` works once and again after a new `initialize`. - **`guest_np_cpp_web_api_signed_out`** used to call `initialize` and `terminate` with no arguments. Its request flows now: - set up a `LibContext`; - initialize each parameter through a small adapter with real arguments; - pass the parameter to `terminate`; - tear the context down. The rest of each flow is unchanged. Also run: - `python3 tools/check_conventions.py --base origin/main` passes. - `python3 tools/pr_overlap.py --branch feat/npcppwebapi-userprofile-parameter-lifecycles` reported two overlaps: - **#11235 (mine)** at `GuestNpCppWebApiSignedOut.cpp` L116-117. It has merged, and this branch is rebased onto it: the flow keeps #11235's `finish` expectation (`0x80553508`) and this PR's `terminate(parameter)`. - **#11631** at `docs/dev/debt/libSceNpCppWebApi.md` L9. It adds `BasicProfileApi::ParameterToGetPublicProfile` to the list this PR rewrites. #11631 lands first, so this PR declares `Depends on: #11631`. Once it lands I'll rebase and keep that class in a "succeeds without storing state" sentence until it gets the same lifecycle. - The branch was stacked on #11636 so the test additions do not collide. #11635 and #11636 have merged, so only this PR's commit is left on top of `main`. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: #11631 (#11636 has merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 01:05:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T01:05:38Z.

Review: CHANGES_REQUESTED


The parameter lifecycle changes and declared dependency on #11636 are clear. Please also resolve the reported overlap with open #11235: the PR description says the signed-out test and debt-document changes will be rebased whichever lands second, but does not record an agreed ordering/dependency. CONTRIBUTING.md requires authors of overlapping PRs to agree which goes first and declare it with Depends on. A merge-tree check confirms both GuestNpCppWebApiSignedOut.cpp and docs/dev/debt/libSceNpCppWebApi.md conflict with #11235 as currently submitted. Please coordinate the order and reflect it on the checklist, or update the overlap report if it no longer applies.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661079039 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11639#pullrequestreview-5661079039). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T01:05:38Z. **Review:** CHANGES_REQUESTED --- The parameter lifecycle changes and declared dependency on #11636 are clear. Please also resolve the reported overlap with open #11235: the PR description says the signed-out test and debt-document changes will be rebased whichever lands second, but does not record an agreed ordering/dependency. `CONTRIBUTING.md` requires authors of overlapping PRs to agree which goes first and declare it with `Depends on`. A merge-tree check confirms both `GuestNpCppWebApiSignedOut.cpp` and `docs/dev/debt/libSceNpCppWebApi.md` conflict with #11235 as currently submitted. Please coordinate the order and reflect it on the checklist, or update the overlap report if it no longer applies.
MarcZX10 commented 2026-10-27 02:07:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T02:07:09Z.

Review: CHANGES_REQUESTED


Supplemental integration review of exact head b02748c024c9678be1f323ed26f6c4f0928c33c8.

The previously reported #11235 ordering issue remains unresolved: the description still says whichever PR lands second will be rebased, without recording an agreed order. I also independently checked the newly disclosed overlap with #11631 using the current heads. git merge-tree --write-tree refs/review/11631 refs/review/11639 reports a content conflict in docs/dev/debt/libSceNpCppWebApi.md; #11631 + #11636 merges cleanly, so the conflict is introduced by #11639's debt edit. The #11639 description proposes retaining #11631's BasicProfile entry, but does not record a coordinated landing order or list #11631 in Depends on.

Please coordinate merge order for both #11235 and #11631 with their authors and record the applicable dependencies/order in the checklist (or document that a conflict has been resolved). I am not asking anyone to close their PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661429788 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11639#pullrequestreview-5661429788). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T02:07:09Z. **Review:** CHANGES_REQUESTED --- Supplemental integration review of exact head `b02748c024c9678be1f323ed26f6c4f0928c33c8`. The previously reported #11235 ordering issue remains unresolved: the description still says whichever PR lands second will be rebased, without recording an agreed order. I also independently checked the newly disclosed overlap with #11631 using the current heads. `git merge-tree --write-tree refs/review/11631 refs/review/11639` reports a content conflict in `docs/dev/debt/libSceNpCppWebApi.md`; #11631 + #11636 merges cleanly, so the conflict is introduced by #11639's debt edit. The #11639 description proposes retaining #11631's BasicProfile entry, but does not record a coordinated landing order or list #11631 in `Depends on`. Please coordinate merge order for both #11235 and #11631 with their authors and record the applicable dependencies/order in the checklist (or document that a conflict has been resolved). I am not asking anyone to close their PR.
MarcZX10 commented 2026-10-27 11:02:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T11:02:17Z.

Review: APPROVED


Reviewed exact head 46f4b0f7f8. The five lifecycle implementations follow the inspected module checks; the filter request body is validated, and failed initialization leaves the parameter uninitialized. The tests cover constructor state, invalid context/arguments, body absence, double initialization, and repeated initialize/terminate cycles. The signed-out request test also exercises the offline error path.

Independent local check: built the exact offline and signed-out WebApi test targets and ran both under qemu-x86_64 -cpu max; both exited successfully. The author reports the full focused set passing natively on WSL, and hosted Windows passed. This PR depends on #11636 and #11631. Main has advanced four commits beyond the base without changing these paths; please update the stack before merge. I found no additional defect in the reviewed lifecycle scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5665977261 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11639#pullrequestreview-5665977261). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T11:02:17Z. **Review:** APPROVED --- Reviewed exact head 46f4b0f7f88df57a43ee5dde0c3708e541379b87. The five lifecycle implementations follow the inspected module checks; the filter request body is validated, and failed initialization leaves the parameter uninitialized. The tests cover constructor state, invalid context/arguments, body absence, double initialization, and repeated initialize/terminate cycles. The signed-out request test also exercises the offline error path. Independent local check: built the exact offline and signed-out WebApi test targets and ran both under `qemu-x86_64 -cpu max`; both exited successfully. The author reports the full focused set passing natively on WSL, and hosted Windows passed. This PR depends on #11636 and #11631. Main has advanced four commits beyond the base without changing these paths; please update the stack before merge. I found no additional defect in the reviewed lifecycle scope.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!11639
No description provided.