Skip to content

feat(libSceNpCppWebApi): track the UserProfile, ProfanityFilter and CommunicationRestrictionStatus parameter lifecycles as the module does - #11639

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
AlexFigas:feat/npcppwebapi-userprofile-parameter-lifecycles
Oct 29, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
AlexFigas:feat/npcppwebapi-userprofile-parameter-lifecycles

Conversation

@AlexFigas

@AlexFigas AlexFigas commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

Five parameter classes returned 0 from initialize and terminate, which were declared without parameters, and their constructors left the object untouched:

  • UserProfile::V1::FriendsApi::ParameterToGetFriends
  • UserProfile::V1::PresenceApi::ParameterToGetBasicPresences
  • UserProfile::V1::BlocksApi::ParameterToGetBlockingUsers
  • ProfanityFilter::V2::ProfanityApi::ParameterToFilterProfanity
  • CommunicationRestrictionStatus::V3::CommunicationRestrictionStatusApi::ParameterToGetCommunicationRestrictionStatus

They now follow the module bundled with PPSA21564 (sce_module/libSceNpCppWebApi.prx, the library's own code), with the helpers from #11635.

Member Module Here
constructor (0x358250, 0x35ffb0, 0x353530, 0x1bbc70, 0x5a290) ParameterBase constructor zeroes +0, then +8 = 0 ConstructParameter
initialize null LibContext → 0x80553503; context not found → 0x80553502; +8 != 0 → 0x8055350f; then allocates and runs ParameterBase::initialize InitializeParameter, same checks in the same order
GetFriends (0x3582b0), GetBasicPresences (0x360010) initialize(LibContext*, const char*) String::copyFrom of the account ID(s); a null one gives 0x80553503 and undoes everything same result
GetBlockingUsers (0x353590) initialize(LibContext*), GetCommunicationRestrictionStatus (0x5a2f0) initialize(LibContext*, unsigned long) no further checks; the latter stores the account ID the account ID is not kept
FilterProfanity initialize(LibContext*, const char* locale, const char* serviceLabel, IntrusivePtr<WebApiFilterRequest>) (0x1bbcd0) copies both strings (0x80553503 for null), then an empty filter request returns 0x80553512 after undoing everything InitializeParameterWithBody
terminate (0x358460, 0x360190, 0x353670, 0x1bbff0, 0x5a3e0) +8 == 0 → 0x80553510; otherwise frees it, +8 = 0 TerminateParameter

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 now declares these members with their real parameters. The UserProfile/ProfanityFilter/CommunicationRestrictionStatus silent-stub debt entry now records what these five classes keep.

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

  • guest_np_cpp_web_api_offline gains TestUserProfileParameterLifecycles. It 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 missing argument leaves the parameter uninitialized: 0x80553503 for a null string, 0x80553512 for an empty WebApiFilterRequest;
    • initialize succeeds, a second call returns 0x8055350f, and terminate works once and again after a new initialize.
  • guest_np_cpp_web_api_signed_out used to call initialize and terminate with no arguments. Its request flows now:

    • set up a LibContext;
    • initialize each parameter through a small adapter with real arguments;
    • pass the parameter to terminate;
    • tear the context down.

    The rest of each flow is unchanged.

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 parameter lifecycle changes and declared dependency on #11636 are clear. Please also resolve the reported overlap with open #11235: the PR description says the signed-out test and debt-document changes will be rebased whichever lands second, but does not record an agreed ordering/dependency. CONTRIBUTING.md requires authors of overlapping PRs to agree which goes first and declare it with Depends on. A merge-tree check confirms both GuestNpCppWebApiSignedOut.cpp and docs/dev/debt/libSceNpCppWebApi.md conflict with #11235 as currently submitted. Please coordinate the order and reflect it on the checklist, or update the overlap report if it no longer applies.

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

Supplemental integration review of exact head b02748c024c9678be1f323ed26f6c4f0928c33c8.

The previously reported #11235 ordering issue remains unresolved: the description still says whichever PR lands second will be rebased, without recording an agreed order. I also independently checked the newly disclosed overlap with #11631 using the current heads. git merge-tree --write-tree refs/review/11631 refs/review/11639 reports a content conflict in docs/dev/debt/libSceNpCppWebApi.md; #11631 + #11636 merges cleanly, so the conflict is introduced by #11639's debt edit. The #11639 description proposes retaining #11631's BasicProfile entry, but does not record a coordinated landing order or list #11631 in Depends on.

Please coordinate merge order for both #11235 and #11631 with their authors and record the applicable dependencies/order in the checklist (or document that a conflict has been resolved). I am not asking anyone to close their PR.

@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-userprofile-parameter-lifecycles branch from b02748c to 46f4b0f Compare October 27, 2026 09:09
@AlexFigas

Copy link
Copy Markdown
Contributor Author

@MarcZX10 #11235 has merged. This PR is rebased onto main 5bc8403 (46f4b0f); the signed-out flow keeps #11235's finish expectation and this PR's terminate(parameter). #11631 lands first: the checklist now says Depends on: #11636, #11631, and I've noted it on #11631. Once it lands I'll rebase and keep its ParameterToGetPublicProfile in the stateless sentence. The 4 np_cpp_web_api tests pass.

@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 46f4b0f. The five lifecycle implementations follow the inspected module checks; the filter request body is validated, and failed initialization leaves the parameter uninitialized. The tests cover constructor state, invalid context/arguments, body absence, double initialization, and repeated initialize/terminate cycles. The signed-out request test also exercises the offline error path.

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 set passing natively on WSL, and hosted Windows passed. This PR depends on #11636 and #11631. 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 lifecycle scope.

@maskym

maskym commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Windows result for head 46f4b0f7f8, 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, #11644, #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.

@oneandonlydean
oneandonlydean merged commit d65bff2 into boykopovar:main Oct 29, 2026
15 of 16 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.

4 participants