feat(libSceNpWebApi2): implement sceNpWebApi2PushEventAbortHandle #4375

Closed
milescoviello wants to merge 1 commit from upstream-pr/4375 into main
milescoviello commented 2026-10-12 08:12:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-12T08:12:57Z.


What

Fixes #4174. Carries @screamm's fix branch from that issue (screamm:feat/npwebapi2-push-event-abort, 2d9c2e45), keeping the commit and its authorship as is, as the issue invites. It is cherry-picked onto current main; besides the commit's own code, only its TechnicalDebt edit changed, to follow the move to one file per library (#4411): the stub entry leaves docs/dev/debt/libSceNpWebApi2.md's Unknown function info and the new entry goes under that file's Functional section.

sceNpWebApi2PushEventAbortHandle (NID 1OLgvahaSco) threw NotImplemented; Planet Coaster (PPSA01736) imports it (import evidence from merged #3399). From the issue:

  • Push-event handles are now registered per library context on the existing context map and mutex, following shadPS4 np_web_api2_internal.cpp (abortPushEventHandle), np_web_api2_context.cpp and np_web_api2_push_event.cpp at e0a46675: CreateHandle returns LIB_CONTEXT_NOT_FOUND (0x80553404) for an unknown context and registers the handle; AbortHandle returns LIB_CONTEXT_NOT_FOUND / HANDLE_NOT_FOUND (0x8055340D) for an unknown context or handle and otherwise marks the handle aborted (idempotent, 0); CreateFilter on an aborted handle returns ABORTED (0x80553409); DeleteHandle validates the same way and removes the handle; Terminate drops the context's handles. In shadPS4 the only effect of abort is that ABORTED result, so registered callbacks are left alone; handle timeouts are not modelled. The codes are PS4 numbering, unverified on PS5 (TechnicalDebt). Note for reviewers: CreateHandle, DeleteHandle and CreateFilter previously accepted any id and now return these errors; the sibling GetMemoryPoolStats still throws for an unknown context, and the existing SCE_NP_WEBAPI2_ERROR_UNAVAILABLE (0x80553406) is shadPS4's REQUEST_NOT_FOUND, left unchanged.
  • guest_np_web_api2 covers two handles (abort one twice, filter creation ABORTED on it and unaffected on the other), the wrong-context, unknown-handle and unknown-context codes, delete then abort/delete again, and abort after Terminate.

Tested

  • Linux, added for this carry: Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags, rebased onto main 1acfa7f7. guest_np_web_api2 passes and fails with main's Export.cpp, and all 310 guest_* tests pass.
  • Windows: @screamm's run in #4174 (Windows 11, WinLibs MinGW-w64 GCC 15.2.0): guest_np_web_api2 3/3 plus the full suite results listed there.
  • tools/check_conventions.py --base upstream/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4826685088 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4375). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-12T08:12:57Z. --- ### What Fixes #4174. Carries @screamm's fix branch from that issue (`screamm:feat/npwebapi2-push-event-abort`, `2d9c2e45`), keeping the commit and its authorship as is, as the issue invites. It is cherry-picked onto current `main`; besides the commit's own code, only its TechnicalDebt edit changed, to follow the move to one file per library (#4411): the stub entry leaves `docs/dev/debt/libSceNpWebApi2.md`'s Unknown function info and the new entry goes under that file's Functional section. `sceNpWebApi2PushEventAbortHandle` (NID `1OLgvahaSco`) threw `NotImplemented`; Planet Coaster (PPSA01736) imports it (import evidence from merged #3399). From the issue: - Push-event handles are now registered per library context on the existing context map and mutex, following shadPS4 `np_web_api2_internal.cpp` (`abortPushEventHandle`), `np_web_api2_context.cpp` and `np_web_api2_push_event.cpp` at `e0a46675`: `CreateHandle` returns `LIB_CONTEXT_NOT_FOUND` (0x80553404) for an unknown context and registers the handle; `AbortHandle` returns `LIB_CONTEXT_NOT_FOUND` / `HANDLE_NOT_FOUND` (0x8055340D) for an unknown context or handle and otherwise marks the handle aborted (idempotent, 0); `CreateFilter` on an aborted handle returns `ABORTED` (0x80553409); `DeleteHandle` validates the same way and removes the handle; `Terminate` drops the context's handles. In shadPS4 the only effect of abort is that `ABORTED` result, so registered callbacks are left alone; handle timeouts are not modelled. The codes are PS4 numbering, unverified on PS5 (TechnicalDebt). Note for reviewers: `CreateHandle`, `DeleteHandle` and `CreateFilter` previously accepted any id and now return these errors; the sibling `GetMemoryPoolStats` still throws for an unknown context, and the existing `SCE_NP_WEBAPI2_ERROR_UNAVAILABLE` (0x80553406) is shadPS4's `REQUEST_NOT_FOUND`, left unchanged. - `guest_np_web_api2` covers two handles (abort one twice, filter creation `ABORTED` on it and unaffected on the other), the wrong-context, unknown-handle and unknown-context codes, delete then abort/delete again, and abort after `Terminate`. ### Tested - Linux, added for this carry: Ubuntu 24.04, GCC 13.3 (CI's compiler), Release with CI's configure flags, rebased onto `main` 1acfa7f7. `guest_np_web_api2` passes and fails with `main`'s `Export.cpp`, and all 310 `guest_*` tests pass. - Windows: @screamm's run in #4174 (Windows 11, WinLibs MinGW-w64 GCC 15.2.0): `guest_np_web_api2` 3/3 plus the full suite results listed there. - `tools/check_conventions.py --base upstream/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-12 08:27:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T08:27:57Z.


Progress report (1acfa7f → 2efa438)

📈 System libraries: 86.39% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceNpWebApi2 sceNpWebApi2PushEventAbortHandle
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6120575041 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4375#issuecomment-6120575041). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T08:27:57Z. --- <!-- progress-report --> ### Progress report (1acfa7f → 2efa438) 📈 **System libraries**: 86.39% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceNpWebApi2 | `sceNpWebApi2PushEventAbortHandle` | </details>
xXPBSXx commented 2026-10-12 11:51:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-12T11:51:17Z.


Windows test: head 13d9cdd04 merged onto current main 3d8ffeb27 (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j4: full build 0 errors; ctest with the filter guest_np_web_api2: guest_np_web_api2 passed (1 test(s), 0 failed); python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6123695374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4375#issuecomment-6123695374). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-12T11:51:17Z. --- Windows test: head `13d9cdd04` merged onto current `main` `3d8ffeb27` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j4`: full build 0 errors; ctest with the filter `guest_np_web_api2`: guest_np_web_api2 passed (1 test(s), 0 failed); `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
github-actions[bot] commented 2026-10-12 23:28:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-12T23:28:14Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#4834 core/libs/tests/GuestNpWebApi2.cpp L17
docs/dev/debt/libSceNpWebApi2.md L5-6
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6134582993 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4375#issuecomment-6134582993). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T23:28:14Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #4834 | `core/libs/tests/GuestNpWebApi2.cpp` [L17](https://github.com/boykopovar/AnyPS5/blob/1c5e62878ab01af05d5a75bd94146228f5dea9d4/core/libs/tests/GuestNpWebApi2.cpp#L17)<br>`docs/dev/debt/libSceNpWebApi2.md` [L5-6](https://github.com/boykopovar/AnyPS5/blob/1c5e62878ab01af05d5a75bd94146228f5dea9d4/docs/dev/debt/libSceNpWebApi2.md#L5-L6) | | |
oneandonlydean commented 2026-10-13 00:21:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:21:33Z.


Closing: PPSA01736 imports sceNpWebApi2PushEventAbortHandle but #4174 says the call has not been seen executing, and the commit also changes what CreateHandle, DeleteHandle and CreateFilter return for every title, from PS4 codes. #4188 carries the same commit. Reopen with the log line where a title stops at it on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135189815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4375#issuecomment-6135189815). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:21:33Z. --- Closing: PPSA01736 imports `sceNpWebApi2PushEventAbortHandle` but #4174 says the call has not been seen executing, and the commit also changes what `CreateHandle`, `DeleteHandle` and `CreateFilter` return for every title, from PS4 codes. #4188 carries the same commit. Reopen with the log line where a title stops at it on main.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4375
No description provided.