You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DPI follow-up (#977): decide on one-off AuthorAiRequests orphan sweep for users anonymized before the cascade fix #3144
Follow-up from #977 (PR #3139). The DPI work fixed a live anonymization-cascade erasure gap: AuthorAiRequests rows are keyed on authorId (the XSUAA id string, e.g. Users.sapId), not user_ID, so the old cascade (WHERE <field> = user.ID) never matched them — those rows (sourceMarkdown, variants) survived user anonymization as FK-ghosts. The fix (via the shared data-subject-resolver.js) now resolves authorId correctly, so erasure works going forward.
Open question (this issue): users anonymized before the fix shipped may still have surviving AuthorAiRequests rows attributable to them. Decide whether a one-off repair sweep is needed before (or shortly after) PROD.
Scope the exposure
Run against PROD (and DEV) to see if any candidate ghosts exist:
-- AuthorAiRequests whose authorId no longer maps to a live (non-anonymized) userSELECTCOUNT(*) FROM com_sap_developers_ims_AuthorAiRequests a
WHERE NOT EXISTS (
SELECT1FROM com_sap_developers_ims_Users u WHEREu.sapId=a.authorId
);
(Refine against whatever marks an anonymized user — the anonymization replaces identifying fields, so the join may need to target the anonymized-placeholder pattern rather than row absence. Confirm the exact anonymized-user signature before trusting the count.)
If the count is 0, close this — no backfill needed. If > 0, decide:
delete those rows (matches the intended erasure semantics), or
leave them if policy says pre-fix data is out of scope.
The DEV runtime verification (export returns NCLOB content; cascade erasure → 0 for a seeded authorId-keyed user) should be run after the fix(#977): add approuter route for /admin/data-privacy #3142 approuter-route redeploy — that proves the forward path on real HANA; this issue is only about pre-fix historical rows.
Also pending (separate, non-blocking): a dedicated test/hybrid/dpi-export.test.js against real HANA (template: test/hybrid/validate-answer-anonymize.test.js).
Scoping result: 0 candidate ghosts in both PROD and DEV → no backfill sweep needed
Ran the exposure scoping against real HANA via cds bind --exec (read-only, no writes) on 2026-11-20.
AuthorAiRequests is empty in both environments — the table is deployed but has never been written to:
Env
Users (sanity)
Tutorials (sanity)
AuthorAiRequests total
PROD
826,055
3,010
0
DEV
789,106
2,975
0
(Distinct user/tutorial counts confirm the two queries hit genuinely different HDI containers, not the same one twice.)
Since total rows = 0, every derived count is trivially 0: naive-query ghosts, true orphans (no Users match by sapIdoruuid), and anonymized-user ghosts (match an ANONYMIZED user via uuid) are all 0.
A correction to the proposed query
The issue's NOT EXISTS (... u.sapId = a.authorId) is overbroad and would mislead if the table were non-empty. Anonymization (srv/lib/anonymization.js) does an identity-replace in place, not a row delete: it sets sapId = NULL, email = NULL, names → 'ANONYMIZED', but keeps uuid and keeps the row. Meanwhile the forward-path resolver (data-subject-resolver.js: authorIdCandidates) matches authorId against both sapId and uuid.
So the correct pre-fix-ghost signature is:
true orphan:authorId matches no user by sapId OR uuid, or
anonymized-user ghost:authorId matches a user via uuid where sapId IS NULL AND displayName = 'ANONYMIZED' (still carrying sourceMarkdown/variants).
Matching only on sapId would false-positive on every live user whose login claim is stored in uuid (the documented provider divergence).
Recommendation
Close as "no action required." The feature (feature='os-variants' author AI, SAP-employee authors only) has produced zero rows in PROD, so no pre-fix user anonymization could have left an AuthorAiRequests ghost. The forward-path fix (merged with #977) covers any future rows. No one-off sweep is warranted before or after PROD cutover.
If the team still wants a belt-and-braces safety net, the cheapest option is a cron assertion (not a one-off migration): fail/alert if anonymized_user_ghosts_with_content > 0 ever becomes non-zero — but given 0 rows total, even that is optional.
Closing per scoping above: 0 AuthorAiRequests rows in PROD and DEV, so no pre-fix orphan ghosts exist. No backfill sweep needed. Forward-path fix (#977) covers future rows.
Activity
jung-thomas commentedon Nov 20, 2026
Scoping result: 0 candidate ghosts in both PROD and DEV → no backfill sweep needed
Ran the exposure scoping against real HANA via
cds bind --exec(read-only, no writes) on 2026-11-20.AuthorAiRequestsis empty in both environments — the table is deployed but has never been written to:AuthorAiRequeststotal(Distinct user/tutorial counts confirm the two queries hit genuinely different HDI containers, not the same one twice.)
Since total rows = 0, every derived count is trivially 0: naive-query ghosts, true orphans (no
Usersmatch bysapIdoruuid), and anonymized-user ghosts (match anANONYMIZEDuser viauuid) are all 0.A correction to the proposed query
The issue's
NOT EXISTS (... u.sapId = a.authorId)is overbroad and would mislead if the table were non-empty. Anonymization (srv/lib/anonymization.js) does an identity-replace in place, not a row delete: it setssapId = NULL,email = NULL, names →'ANONYMIZED', but keepsuuidand keeps the row. Meanwhile the forward-path resolver (data-subject-resolver.js: authorIdCandidates) matchesauthorIdagainst bothsapIdanduuid.So the correct pre-fix-ghost signature is:
authorIdmatches no user bysapIdORuuid, orauthorIdmatches a user viauuidwheresapId IS NULL AND displayName = 'ANONYMIZED'(still carryingsourceMarkdown/variants).Matching only on
sapIdwould false-positive on every live user whose login claim is stored inuuid(the documented provider divergence).Recommendation
Close as "no action required." The feature (
feature='os-variants'author AI, SAP-employee authors only) has produced zero rows in PROD, so no pre-fix user anonymization could have left anAuthorAiRequestsghost. The forward-path fix (merged with #977) covers any future rows. No one-off sweep is warranted before or after PROD cutover.If the team still wants a belt-and-braces safety net, the cheapest option is a cron assertion (not a one-off migration): fail/alert if
anonymized_user_ghosts_with_content > 0ever becomes non-zero — but given 0 rows total, even that is optional.jung-thomas commentedon Nov 20, 2026
Closing per scoping above: 0 AuthorAiRequests rows in PROD and DEV, so no pre-fix orphan ghosts exist. No backfill sweep needed. Forward-path fix (#977) covers future rows.