feat(libSceNpCppWebApi): track the remaining SessionManager V1 parameter lifecycles as the module does #11644

Merged
AlexFigas merged 4 commits from upstream-pr/11644 into main 2026-11-02 12:26:21 +00:00
AlexFigas commented 2026-10-27 00:52:51 +00:00 (Migrated from github.com)

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


What

The five remaining SessionManager::V1::PlayerSessionsApi parameter classes that PPSA20397 imports kept no state:

  • ParameterToGetPlayerSessions
  • ParameterToSendPlayerSessionInvitations
  • ParameterToSetPlayerSessionProperties
  • ParameterToChangePlayerSessionLeader
  • ParameterToAddPlayerSessionJoinableSpecifiedUsers

Every member, constructors included, was declared without parameters and returned 0. They now follow the module bundled with PPSA21564 (sce_module/libSceNpCppWebApi.prx, the library's own code), like the four classes in #11635. With this PR, every PlayerSessionsApi parameter AnyPS5 exports tracks its lifecycle.

Member Module Here
constructor (0x29b470, 0x2a1520, 0x2a45a0, 0x293ac0, 0x292810) ParameterBase constructor zeroes +0, then +8 = 0 ConstructParameter
GetPlayerSessions::initialize(LibContext*, const char*) (0x29b4d0) null LibContext → 0x80553503; context not found → 0x80553502; +8 != 0 → 0x8055350f; then String::copyFrom, where a null string gives 0x80553503 and undoes everything InitializeParameter
the other four initialize(LibContext*, const char* sessionId, IntrusivePtr<…RequestBody>) (0x2a1580, 0x2a4600, 0x293b20, 0x292870) the same checks and copy of the session ID, then an empty request body returns 0x80553512 after undoing everything InitializeParameterWithBody, as ParameterToJoinPlayerSessionAsPlayer in #11635
terminate (0x29b6a0, 0x2a1920, 0x2a49a0, 0x293ec0, 0x292c10) +8 == 0 → 0x80553510; otherwise frees it, +8 = 0 TerminateParameter
destructor jmp ParameterBase::~ParameterBase does nothing

GetPlayerSessions::setfields (0x29b850) keeps its no-op, as GetPlayerSessionInvitations::setfields does in #11635. 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 declares the members with their real parameters. The PPSA20397 debt entry now says the PlayerSessionsApi parameters are the exception to "parameter bookkeeping succeeds without state".

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), and python3 core/libs/tests/test_public_headers.py --audit-only verifies 368 libraries and 12811 exports. guest_np_cpp_web_api_offline gains TestPlayerSessionParameterLifecycles, which 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 null session ID gives 0x80553503 and an empty request body gives 0x80553512, both leaving the parameter uninitialized;
  • initialize succeeds, a second call returns 0x8055350f, and terminate works once and again after a new initialize.

The four body-taking classes share an InitializeSessionWithBody helper in the test.

Also run:

  • python3 tools/check_conventions.py --base origin/main passes.
  • python3 tools/pr_overlap.py --branch feat/npcppwebapi-sessionmanager-remaining-parameter-lifecycles reports #12447, which edits the debt entry below this PR's line; it declares Depends on: #11644 and follows this PR. #11631 conflicts with main, so the tool could not compare it; it gives the same git merge-tree conflicts with this branch as with main.
    • This commit also edits the PPSA20397 debt entry that #11235 rewrote. #11235 has merged, and this branch is rebased onto it: the entry keeps both sentences, trimmed to stay under 1000 characters.
  • The branch was stacked on #11639, #11635 and #11636, which have all merged, so it now holds only this PR's commit.

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: none (#11639 has merged)
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5026898267 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11644). Originally posted by [AlexFigas](https://github.com/AlexFigas) on 2026-10-27T00:52:51Z. --- ### What The five remaining `SessionManager::V1::PlayerSessionsApi` parameter classes that PPSA20397 imports kept no state: - `ParameterToGetPlayerSessions` - `ParameterToSendPlayerSessionInvitations` - `ParameterToSetPlayerSessionProperties` - `ParameterToChangePlayerSessionLeader` - `ParameterToAddPlayerSessionJoinableSpecifiedUsers` Every member, constructors included, was declared without parameters and returned 0. They now follow the module bundled with PPSA21564 (`sce_module/libSceNpCppWebApi.prx`, the library's own code), like the four classes in #11635. With this PR, every `PlayerSessionsApi` parameter AnyPS5 exports tracks its lifecycle. | Member | Module | Here | |---|---|---| | constructor (0x29b470, 0x2a1520, 0x2a45a0, 0x293ac0, 0x292810) | `ParameterBase` constructor zeroes +0, then `+8 = 0` | `ConstructParameter` | | `GetPlayerSessions::initialize(LibContext*, const char*)` (0x29b4d0) | null `LibContext` → `0x80553503`; context not found → `0x80553502`; `+8 != 0` → `0x8055350f`; then `String::copyFrom`, where a null string gives `0x80553503` and undoes everything | `InitializeParameter` | | the other four `initialize(LibContext*, const char* sessionId, IntrusivePtr<…RequestBody>)` (0x2a1580, 0x2a4600, 0x293b20, 0x292870) | the same checks and copy of the session ID, then an empty request body returns `0x80553512` after undoing everything | `InitializeParameterWithBody`, as `ParameterToJoinPlayerSessionAsPlayer` in #11635 | | `terminate` (0x29b6a0, 0x2a1920, 0x2a49a0, 0x293ec0, 0x292c10) | `+8 == 0` → `0x80553510`; otherwise frees it, `+8 = 0` | `TerminateParameter` | | destructor | `jmp ParameterBase::~ParameterBase` | does nothing | `GetPlayerSessions::setfields` (0x29b850) keeps its no-op, as `GetPlayerSessionInvitations::setfields` does in #11635. 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` declares the members with their real parameters. The PPSA20397 debt entry now says the `PlayerSessionsApi` parameters are the exception to "parameter bookkeeping succeeds without state". ### 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), and `python3 core/libs/tests/test_public_headers.py --audit-only` verifies 368 libraries and 12811 exports. `guest_np_cpp_web_api_offline` gains `TestPlayerSessionParameterLifecycles`, which 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 null session ID gives `0x80553503` and an empty request body gives `0x80553512`, both leaving the parameter uninitialized; - `initialize` succeeds, a second call returns `0x8055350f`, and `terminate` works once and again after a new `initialize`. The four body-taking classes share an `InitializeSessionWithBody` helper in the test. Also run: - `python3 tools/check_conventions.py --base origin/main` passes. - `python3 tools/pr_overlap.py --branch feat/npcppwebapi-sessionmanager-remaining-parameter-lifecycles` reports #12447, which edits the debt entry below this PR's line; it declares `Depends on: #11644` and follows this PR. #11631 conflicts with `main`, so the tool could not compare it; it gives the same `git merge-tree` conflicts with this branch as with `main`. - This commit also edits the PPSA20397 debt entry that #11235 rewrote. #11235 has merged, and this branch is rebased onto it: the entry keeps both sentences, trimmed to stay under 1000 characters. - The branch was stacked on #11639, #11635 and #11636, which have all merged, so it now holds only this PR's commit. ### 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: none (#11639 has merged) - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 01:05:40 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


The declared dependency on #11639 correctly captures this stack. There is also a reported overlap with open #11235 in the signed-out test and debt document, described as “whichever lands second gets rebased,” without an agreed order recorded on this PR. CONTRIBUTING.md requires overlapping PRs to agree which goes first and declare the ordering with Depends on. A merge-tree check confirms those two files conflict with #11235 as currently submitted. Please coordinate the order and record it in the checklist (or update the overlap report if resolved).

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5661079230 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11644#pullrequestreview-5661079230). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T01:05:40Z. **Review:** CHANGES_REQUESTED --- The declared dependency on #11639 correctly captures this stack. There is also a reported overlap with open #11235 in the signed-out test and debt document, described as “whichever lands second gets rebased,” without an agreed order recorded on this PR. `CONTRIBUTING.md` requires overlapping PRs to agree which goes first and declare the ordering with `Depends on`. A merge-tree check confirms those two files conflict with #11235 as currently submitted. Please coordinate the order and record it in the checklist (or update the overlap report if resolved).
MarcZX10 commented 2026-10-27 11:02:23 +00:00 (Migrated from github.com)

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

Review: APPROVED


Reviewed exact head 6df6a4b16e. The remaining SessionManager parameter methods use the established lifecycle checks; body-taking initializers reject empty request bodies and clear initialization state on that failure. The tests exercise all five classes through construction, failed and successful initialization, repeated initialization, termination, and reinitialization.

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 suite and public-header audit passing natively on WSL, and hosted Windows passed. This PR depends on #11639. 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 scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5665978355 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11644#pullrequestreview-5665978355). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T11:02:23Z. **Review:** APPROVED --- Reviewed exact head 6df6a4b16e83716a89a731f4d83b5b9fccc062d7. The remaining SessionManager parameter methods use the established lifecycle checks; body-taking initializers reject empty request bodies and clear initialization state on that failure. The tests exercise all five classes through construction, failed and successful initialization, repeated initialization, termination, and reinitialization. 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 suite and public-header audit passing natively on WSL, and hosted Windows passed. This PR depends on #11639. 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 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!11644
No description provided.