Repository navigation
feat(npwebapi): implement error code parsing - #23222
Conversation
PrivacyOnion
left a comment
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 6bc9fef574:
- Conventions:
tools/check_conventions.pypassed. - Build:
guest_np_web_api_testsbuilt cleanly. - CTest (
guest_np_web_api):1/1 Test #4847: guest_np_web_api ................. Passed 0.09 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceNpWebApi/Export.cpp,core/libs/prx/libSceNpWebApi/include/Api.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified sceNpWebApiGetErrorCode signature APS5_VABI (std::int32_t httpStatus, const char* json, std::size_t length) in core/libs/prx/libSceNpWebApi/include/Api.hpp and Export.cpp.
- Verified SDK version dispatch logic using compiledSdkVersion() >= SDK_VERSION_2_50 forwarding to sceNpServerErrorJsonMultiGetErrorCode vs sceNpServerErrorJsonGetErrorCode.
- Verified error code translations for SCE_NP_SERVER_ERROR_JSON_BAD_CODE (0x80559C02 -> 0x8055A401) and SCE_NP_SERVER_ERROR_JSON_BAD_FORMAT (0x80559C03 -> 0x80552914) match PS5 firmware conventions.
- Verified CMake target_link_libraries(libSceNpWebApi PRIVATE libSceNpCommon) correctly links libSceNpCommon for the forwarded parser symbols.
- Verified debt fragment docs/dev/debt/changes/feat-npwebapi-get-error-code.md complies with debt format rules and accurately records the SDK version dispatch gap.
- Verified tests in core/libs/tests/GuestNpWebApi.cpp thoroughly exercise both SDK < 2.50 and >= 2.50 code paths, fallback behavior on null body, and restore SDK version state.
Looks Good To Me
|
Windows result for head Host: Windows 11 26300, Intel i7-12700K, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release,
AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine. |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
The implementation matches the stated SDK-dependent forwarding behavior, and the inspected tests cover both parser modes and HTTP fallback.
What I ran
Reviewed head 6bc9fef57445df6c24b13e7570cf9187bd77e140. No commands or tests were run by me; the author reports a passing test and checks in the PR description.
Results
| Check | Result | Note |
|---|---|---|
| Source review | passed | Implementation and relevant parser code inspected |
| Tests run by reviewer | not run | Author-reported results are not reviewer runs |
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read all five changed files listed as reviewed in the manifest: core/libs/prx/libSceNpWebApi/CMakeLists.txt, core/libs/prx/libSceNpWebApi/Export.cpp, core/libs/prx/libSceNpWebApi/include/Api.hpp, core/libs/tests/GuestNpWebApi.cpp, and docs/dev/debt/changes/feat-npwebapi-get-error-code.md. The review bundle had no excluded files. I also read relevant sections of core/libs/prx/libSceNpCommon/Json.cpp and core/libs/tests/GuestNpCommonRuntime.cpp. Build/test outputs and physical console behavior were not independently verified.
To get this to a good state
Nothing is required.
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
cbf1962 to
fbb8773
Compare
|
Works on Windows with a one-line rename, and one finding blocks: the PR does not build on current Existing runs:
No Windows output has been posted for this head before this one. What this run adds. Windows results at Blocking: the merge does not build.
Code.
Negative control and mutations. The first row is the negative control. Each row is applied alone on
Tests. The test set is
The build of Host:
AI-assisted: yes |
fbb8773 to
76565d3
Compare
|
@Helldiverr Addressed the blocking current-main build issue in |
|
Works on Windows. The new head Existing runs:
What this run adds. This run merges Code. Line numbers are in
Negative control, mutations and probes. The first row is the negative control, and the last row is the probe. Each row is applied alone on the merge. The three test executables are deleted and rebuilt, and the three tests are run once. Every build succeeded. In every row,
Tests.
Times are in seconds. The Host:
AI-assisted: yes |
What
Implement
sceNpWebApiGetErrorCodewith the firmware 13.42 signature and forwarding behavior. SDKs before 2.50 use the single-error libSceNpCommon parser, newer SDKs use its multi-error parser, and the two observed parser errors are translated to their libSceNpWebApi results. Use the currentApplicationCompiledSdkVersion()helper after the old helper was removed, and record the remaining parser-mapping limitation with exact module and error-code evidence.Tested
Ubuntu 24.04 linux/amd64 Docker (
anyps5-dev:24.04) after rebase onto currentmain: builtguest_np_web_api_tests,guest_np_web_api_initialize_tests, andguest_np_web_api2_tests;ctest --test-dir build-codex -R "^guest_np_web_api" --output-on-failurepassed 3/3.git diff --check,python3 tools/debt_fold.py --check, andpython3 tools/check_conventions.py --base origin/mainpassed. The branch overlap check found only this existing PR.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)