fix(libSceNpEntitlementAccess): make abort and delete request idempotent #11941
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11941"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-27T13:15:20Z.
What
sceNpEntitlementAccessAbortRequestandsceNpEntitlementAccessDeleteRequestthrewnot implemented. Both now ignore the request ID and return 0.Every request-creating call in the library fails
SCE_NP_ERROR_SIGNED_OUTbefore minting an ID, so no request can ever exist and the library keeps no request table. Aborting or deleting therefore has nothing to act on; the remaining question was the result code, and there are two sources:NpEntitlementAccessExports.csimplements both as unconditionalORBIS_GEN2_OKfor Gen4 and Gen5, asserted by itsEntitlementRequestLifecycle_AbortAndDeleteSucceedWithNoRequestsOutstandingtest (abort of ID 1, delete called twice, all return 0). The library's debt file already cites sharpemu forsceNpEntitlementAccessGetGameTrialsFlag/sceNpEntitlementAccessGetPftFlag.rlNpSetEntitlementCountWorkItemcallsAbortRequestonly on theSCE_NP_ENTITLEMENT_ACCESS_ERROR_ABORTEDpoll path andDeleteRequestunconditionally at cleanup;ret < SCE_OKfrom either is logged and the work item continues, so an error result is tolerated but success is the intended answer.SCE_NP_ENTITLEMENT_ACCESS_ERROR_NOT_FOUND(0x80558007) was considered and rejected: sharpemu's contract returns OK for an ID that was never created, and titles call delete unconditionally on cleanup of IDs that were never successfully requested.The debt entry now records the contract, the source and the remaining unknown (aborting or deleting an ID a signed-in console's table would still hold is unmeasured).
Same-file adjacency, no functional overlap: #8646 implements the consumable request/poll trio (different exports, currently conflicting with base), #11909 adds signed-out/parameter coverage to the same test file (text-level conflict only), #11529 rewrites the neighbouring
GetEntitlementKeydebt bullet.Tested
Windows 11, WinLibs MinGW-w64 GCC, Ninja Release,
BUILD_TESTING=ON, bundled dependencies.guest_entitlementsextended: abort and delete each return 0 for request IDs 0, 1, -7 andINT64_MAX, delete twice in a row returns 0.ctest -R '^guest_entitlements' -V: 2/2 passed.python tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branchrun; shared-file PRs listed above. No title or console was run.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T13:30:45Z.
Review: CHANGES_REQUESTED
Reviewed exact head
96812a0ae732e8d351872973cafce723b553cee1. The two exports ignore the ID and return success; the test covers zero, positive, negative and maximum IDs plus repeated delete. The signed-out request functions in this library do not mint IDs, and the debt entry preserves the unmeasured signed-in/table-held case. Hosted Windows build and policy checks pass; the PR reportsguest_entitlementspassing 2/2 on Windows. I found no additional implementation issue in this narrow change.There is a merge-order blocker in the overlap checklist. I compared exact current heads with
git merge-tree: #11941 conflicts incore/libs/tests/GuestEntitlements.cppwith open #11909, and indocs/dev/debt/libSceNpEntitlementAccess.mdwith open #11529. The description notes those shared files but does not say which PR lands first, while the checklist saysDepends on: none. Please agree and record the order on the checklist (Depends on: #Nfor the first PR this needs, otherwise explicitly say which lands second and rebase it after the first lands). The #8646 branch separately conflicts with currentmain; that is a stale conflict in #8646'sGuestOfflineImports.cpp, not a file changed by #11941.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T13:36:42Z.
Review: CHANGES_REQUESTED
Re-reviewed new exact head
8328c0a2f1153c86a3584fbf484bd498da693892. The latest checklist now mentions the shared-file order, but exactgit merge-treecomparisons still conflict with both open #11909 (GuestEntitlements.cpp) and #11529 (libSceNpEntitlementAccess.md). “This PR lands second and will be rebased onto whichever of them merges first” does not identify which PR this one depends on; after one lands, the other still overlaps and the order/rebase plan remains unsettled.Please agree with the affected contributors on a specific sequence and record the actual first dependency in
Depends on(and what happens to the other PR) before approval. The current-main merge is clean. This remains a coordination request only; the implementation review found no additional code issue. The Windows build check for this new head is still in progress.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T00:14:12Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The agreed #11529 → #11909 → #11941 sequence and the exact-head Windows control address the earlier blockers, but the branch still needs to be refreshed onto current
main.What I ran
Reviewed head
ffc8b7c45ff032324687636973f5a9f56a2386e7; its merge base with currentmainis319621ba2e578bd053b0baba2877fe70520e0737. The preview merge onto currentmain3a2b91981651569163768854a1fcdc7193b6667bis clean, and no paths changed on both sides since that merge base. Environment: Linux x86-64, Git and GitHub CLI. I did not build or run the tests locally.Results
guest_entitlementsandguest_entitlements_missingpass 3/3 on this headCommand output
Negative control
main'sExport.cppwhile keeping the PR testguest_entitlementsfailed withsceNpEntitlementAccessAbortRequest not implemented; this control is author-reported and was not rerun hereFindings
Blocking
319621ba2e, not currentmain3a2b91981651. The clean preview and lack of changed-path overlap reduce conflict risk, but the contribution rules require keeping the branch current. Please rebase and rerun the focused tests on that tree.Non-blocking
Sources
Not verified
To get this to a good state
Rebase onto current
mainand rerunguest_entitlementsandguest_entitlements_missingon the new head. Keep the #11529/#11909 sequence documented and record the exact base and head. I will re-check the refreshed diff and rerun the focused tests available here.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T05:19:51Z.
Review: APPROVED
Re-checked — looks good
The author’s refresh preserves the reviewed two-commit diff, the agreed #11529 → #11909 → #11941 order is recorded, and the reported entitlement tests cover both exports and the negative control; I found no blocker in the current-head preview.
What I ran
24f5853925950ce81ad9dd5faac19274ebe4410eagainst currentmain52c09d567d2fa453494dd720fcf53a98149468e4.git merge-tree --write-treeand compared paths changed onmainsince the PR merge base.Results
06eb182f50...guest_entitlementsandguest_entitlements_missingpass 3/3 on the pre-refresh head; author says the current rebase preserves the exact diff and the focused tests remain applicablemainversions fails as expectedRaw output
Negative control
The exact-head Windows report describes reverting the implementation to
main; both focused tests then fail in the intended checks. I did not rerun this control locally.Findings
Blocking
Non-blocking
Sources
Not verified