Repository navigation
feat(libSceNpCppWebApi): track the Leaderboards V1 parameter lifecycles as the module does - #11636
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
The lifecycle implementation and its dependency on #11635 look coherent. One repository-rule item remains: this PR reports an overlapping edit with open #11235 in docs/dev/debt/libSceNpCppWebApi.md and says whichever lands second will be rebased. CONTRIBUTING.md asks overlapping PRs to agree which goes first and declare that ordering with Depends on. Please coordinate the order with #11235 and record the agreed dependency in this PR checklist (or explain if the overlap has been resolved). git merge-tree confirms the debt-document edits conflict if combined as currently submitted.
…cles as the module does
…es as the module does
23c3b4c to
a62e4fa
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed exact head a62e4fa. The Leaderboards V1 lifecycle changes use the same helpers already reviewed in #11635, and add the correct context/initialized checks plus the measured missing-body error for RecordScore. The focused tests cover constructors, invalid contexts/arguments, double initialization, terminate-before-init, and reinitialization.
Independent local check: built the exact guest_np_cpp_web_api_offline_tests target and ran it under qemu-x86_64 -cpu max; it passed. The author reports the full focused WebApi test set passing on native WSL, and hosted Windows passed. This PR depends on #11635. Main has advanced four commits from its base, with no changes to these paths; please update the dependency stack before merge per the branch-currency rule. No additional defect found.
|
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, #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 AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
|
Checked the five Leaderboards::V1 parameter lifecycles against the helpers merged with #11635 (same check order and codes, 0x80553512 for an empty |
What
Five
Leaderboards::V1parameter classes kept no state:BoardsApi::ParameterToGetBoardDefinitionRecordApi::ParameterToRecordLargeDataRecordApi::ParameterToRecordScoreViewApi::ParameterToGetLargeDataByObjectIdViewApi::ParameterToGetRankingTheir constructors left the object untouched.
initializeandterminatewere declared without parameters and returned 0. Soinitializeaccepted a nullLibContext, a missing object ID, an empty request body 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), with the helpers from #11635.ParameterBaseconstructor zeroes +0, then+8 = 0ConstructParameterinitializeLibContext→0x80553503; context not found →0x80553502;+8 != 0→0x8055350f; then allocates, runsParameterBase::initializeand stores the argumentsInitializeParameter, same checks in the same orderGetBoardDefinition(0xcbc10),GetRanking(0xf01e0)initialize(LibContext*, int)GetLargeDataByObjectId(0xed970),RecordLargeData(0xe0350)initialize(…, const char*)String::copyFromof the object ID; a null one gives0x80553503and undoes everythingRecordScoreinitialize(LibContext*, int, IntrusivePtr<RecordScoreRequestBody>)(0xe2360)ParameterBase::terminate, frees the implementation and returns0x80553512InitializeParameterWithBodyterminate(0xcbd40, 0xe0530, 0xe2760, 0xedb50, 0xf0350)+8 == 0→0x80553510; otherwise frees it,+8 = 0TerminateParametersetxPsnAtomicOperation(0xe28c0),setgetRankingRequestBody(0xf04a0)+8 != 0and return nothingNo argument is kept, because only a request would read one, and requests fail with
SCE_NP_WEBAPI_ERROR_NOT_SIGNED_INhere.These definitions come before the helpers in
Export.cpp, so the helpers gain forward declarations at the top of theextern "C"block.Api.hppnow declares the members with their real parameters. The Leaderboards::V1 debt entry now covers only the request-body setters andUsersetters, and records what these five classes keep.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_offlinegainsTestLeaderboardsParameterLifecycles. It runs each class throughTestParameterLifecycle:terminatereturns0x80553510beforeinitialize;initializereturns0x80553503for a null context and0x80553502for a contextCommon::initializehas not set;0x80553503and an emptyRecordScoreRequestBodygives0x80553512, both leaving the parameter uninitialized;initializethen succeeds and a second call returns0x8055350f;terminatesucceeds once and again after a newinitialize.Also run:
python3 tools/check_conventions.py --base origin/mainpasses.python3 tools/pr_overlap.py --branch feat/npcppwebapi-leaderboards-parameter-lifecyclesreported fix(libSceNpCppWebApi): answer finish, abort and getId for never-started transactions as the module does #11235 atdocs/dev/debt/libSceNpCppWebApi.mdL5-7, theCommonentry above the Leaderboards one. fix(libSceNpCppWebApi): answer finish, abort and getId for never-started transactions as the module does #11235 has merged, and this branch is rebased onto it, keeping itsCommonentry above this PR's Leaderboards entry.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.main.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)