Skip to content

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

Merged
oneandonlydean merged 4 commits into
boykopovar:mainfrom
AlexFigas:feat/npcppwebapi-sessionmanager-remaining-parameter-lifecycles
Nov 2, 2026
Merged

oneandonlydean merged 4 commits into
boykopovar:mainfrom
AlexFigas:feat/npcppwebapi-sessionmanager-remaining-parameter-lifecycles

Conversation

@AlexFigas

@AlexFigas AlexFigas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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 5bc8403, 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:

Checklist

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

@github-actions github-actions Bot added docs prx needs rebase Conflicts with main, rebase needed labels Oct 27, 2026
@AlexFigas
AlexFigas force-pushed the feat/npcppwebapi-sessionmanager-remaining-parameter-lifecycles branch from 0039b77 to 6df6a4b Compare October 27, 2026 09:09
@AlexFigas

Copy link
Copy Markdown
Contributor Author

@MarcZX10 #11235 has merged. This PR is rebased onto main 5bc8403 (6df6a4b), and the PPSA20397 entry keeps both sentences, trimmed to stay under 1000 characters. #11631 overlaps through #11639, which now declares Depends on: #11636, #11631. The 4 np_cpp_web_api tests pass at each of the four stack commits, and the public-header audit passes at this head.

@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 27, 2026
@AlexFigas
AlexFigas requested a review from MarcZX10 October 27, 2026 10:38

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 6df6a4b. 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.

@maskym

maskym commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Windows result for head 6df6a4b16e, merged into main f759e165d9 (the PR's Tested section names no Windows run).

Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja. Build clean.

The tree also carried the open PRs #11724, #11639, #11636, #11635, #11630, #11353, #11347, #11221, #10925, #11706, #11693, #11686, #11682, all merged cleanly, so the run is a joint one; the tests of this PR are guest_np_cpp_web_api_offline and guest_np_cpp_web_api_signed_out (0.04-0.05 s), all passed (the batch's mapped tests: 16/16, plus 43/43 for the Ngs2 and host-import suites). Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@simnJS

simnJS commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

@AlexFigas #12447 cuts the UserProfile::V1, CommunicationRestrictionStatus::V3 and the remaining Common instantiations entry in docs/dev/debt/libSceNpCppWebApi.md, right below the SessionManager2V1 and InGameCatalog2V5 line this PR rewrites, and appends one entry after it. Git reports that as an adjacent conflict; keeping both edits resolves it, and no code or export is shared. I'd let your stack land first: #12447 now declares Depends on: #11644, and I'll merge main and keep your line once this is in. If you'd rather #12447 went first, tell me and I'll switch the order.

@github-actions

github-actions Bot commented Oct 31, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 12801 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 12808 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 13206 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 13255 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 14122 core/libs/prx/libSceNpCppWebApi/Export.cpp
core/libs/prx/libSceNpCppWebApi/include/Api.hpp
docs/dev/debt/libSceNpCppWebApi.md
PR 14212 docs/dev/debt/libSceNpCppWebApi.md

@AlexFigas

Copy link
Copy Markdown
Contributor Author

@MarcZX10 The approved head 6df6a4b still merges cleanly into current main 8a4fc62. main has changed Export.cpp, Api.hpp and the debt file since, so I built the merge result (d714c2423e) separately and did not move this branch. On it all 9 np_cpp_web_api tests pass 3 runs each, and the header audit verifies 394 libraries and 25093 exports. #12447 still follows this PR (Depends on: #11644).

@AlexFigas

Copy link
Copy Markdown
Contributor Author

@MarcZX10 Update to my earlier comment: main has since gained a tenth np_cpp_web_api test (guest_np_cpp_web_api_activities). The approved head 6df6a4b still merges cleanly into current main e0caf13, and on the merge result (37ca6c61fa) all 10 tests pass 3 runs each; the header audit verifies 399 libraries and 26743 exports. I did not move this branch.

@oneandonlydean
oneandonlydean merged commit 53527ac into boykopovar:main Nov 2, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants