Repository navigation
feat(libSceNpCppWebApi): track the SessionManager V1 parameter lifecycles as the module does - #11635
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The lifecycle implementation appears consistent with the module behavior and the declared tests. I found one contribution-rule issue in the overlap report: the PR says its merge-tree check against #11235 is clean, but a current merge-tree check reports a conflict in docs/dev/debt/libSceNpCppWebApi.md. Comparing the three versions shows both PRs edit the SessionManager2V1 debt entry. CONTRIBUTING.md requires overlapping PRs to agree which goes first and declare that order with Depends on. Please coordinate with #11235 and update the overlap report/checklist to record the agreed order (or correct the report if the overlap has since been resolved).
…cles as the module does
7c8d0b0 to
7054872
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head 7054872. The shared lifecycle helpers check context, initialization state, missing arguments/body, and terminate state in the order described from the bundled module; constructors initialize the object state, and failures leave it uninitialized. The debt entry records that string/body contents remain unretained while requests are unsupported offline. I found no correctness issue in the scoped lifecycle behavior.
Independent local check: built guest_np_cpp_web_api_offline_tests; it passed under qemu-x86_64 -cpu max. Native execution is blocked by this host's AVX2/FMA guard; the author reports all four focused WebApi tests passing natively on WSL, and the hosted Windows check passes. Main has advanced four commits beyond the PR's base, but none touched these files; please bring the stack up to current main before merge per the branch-currency rule. This approval covers the reviewed code and test evidence, not the required rebase.
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, The tree also carried the open PRs #11724, #11644, #11639, #11636, #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 AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
Checked the constructor, initialize (null context, unset context, already initialized, null string, empty request body), terminate and |
What
Four
SessionManager::V1::PlayerSessionsApiparameter classes returned 0 from every member and kept no state:ParameterToCreatePlayerSessionsParameterToGetPlayerSessionInvitationsParameterToJoinPlayerSessionAsPlayerParameterToLeavePlayerSessionSo
initializeaccepted a nullLibContext, missing arguments and a second call, andterminateaccepted a parameter that was never initialized. They now follow the module bundled with PPSA21564 (sce_module/libSceNpCppWebApi.prx, the library's own code), the same way #11252 made the TitleCloudStorage and InGameCatalog parameters do.In the module, each of these objects is
{ParameterBase implementation at +0, class implementation at +8}:ParameterBaseconstructor zeroes +0, then+8 = 0ConstructParameterzeroes +0 and +8initialize(0x294980, 0x299a00, 0x29cd90, 0x29fc20)LibContext→0x80553503; context not found →0x80553502;+8 != 0→0x8055350f. It then allocates, runsParameterBase::initializeandString::copyFromof each string argument; a null string gives0x80553503and undoes everythingInitializeParameter, same checks in the same orderinitializewith a request body (Create, Join)IntrusivePtrbody whose object is null runsParameterBase::terminate, frees the implementation and returns0x80553512InitializeParameterWithBody: the same result, and the parameter stays uninitializedsetinvitationInvalidFilter(0x299e70)+8 == 0→0x80553502; otherwiseString::copyFrom,0x80553503for nullSetParameterTextterminate(0x294d20, 0x29d170, 0x29fe50)ParameterBase::terminate;+8 == 0→0x80553510; otherwise frees it and sets+8 = 0TerminateParameterjmp ParameterBase::~ParameterBaseA few things are not kept:
SCE_NP_WEBAPI_ERROR_NOT_SIGNED_INhere.setfields(0x299d20). The module stores the vector only once initialized and returns nothing; here it stays a no-op.GetPlayerSessionInvitations::terminate. It is not exported here, so this PR does not add it.Api.hppnow declares these members with their real parameters. The SessionManager::V1 debt entry now says which members keep only their initialized state and which setters still store nothing.Tested
On Ubuntu 24.04 under WSL2 (GCC 13.3, Release), rebased onto
main5bc8403,ctest --test-dir build -R np_cpp_web_apipasses all 4 tests (2 runs).guest_np_cpp_web_api_offlinegainsTestSessionManagerParameterLifecycles:Create, Join and Leave go through
TestParameterLifecycle, the sequence from feat(libSceNpCppWebApi): track the TitleCloudStorage and InGameCatalog parameter lifecycles as the module does #11252:terminatereturns0x80553510beforeinitialize;initializereturns0x80553503for a null context and0x80553502for a context thatCommon::initializehas not set;0x80553503and leaves the parameter uninitialized;initializethen succeeds, a second call returns0x8055350f, andterminateworks once and again after a newinitialize.Create and Join also check
0x80553512for an empty request body. The helper now accepts a class without a string setter, and checks that a failedinitializechanged nothing throughterminaterather than the setter.GetPlayerSessionInvitations runs the same checks without
terminate, throughsetinvitationInvalidFilter.Also run:
python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.py --branch feat/npcppwebapi-sessionmanager-parameter-lifecyclesreports no overlap.git merge-treeagainst fix(libSceNpCppWebApi): count Vector<String> and Vector<unsigned long> references where the bundled module does #10925, feat(libSceNpCppWebApi): iterate Vector<String> with begin, end and the Iterator<String> operators #11221 and feat(libSceNpCppWebApi): answer the singular public profile request offline #11631 merges cleanly. fix(libSceNpCppWebApi): answer finish, abort and getId for never-started transactions as the module does #11235, which edits the same debt file, has merged, and this commit rebased onto it without a conflict.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)