Enforce privacy settings at runtime and expand data export/deletion test coverage#174
Merged
Kaylahray merged 1 commit intoApr 28, 2026
Conversation
phertyameen
force-pushed
the
feat/dataRetentionMonths__#162_#163_#164
branch
from
April 27, 2026 23:15
58d698f to
621a973
Compare
Kaylahray
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #162, #163, #164
What changed
#162 – Data retention lifecycle (DataRetentionJob)
Added
DataRetentionJobwith arun()batch method (nightly cron) andenforceForUser()for on-demand sweeps. Deletes audit logs, authored reviews, and sent tips older than the user'sdataRetentionMonthscutoff. Emits an audit event when rows are removed.#163 – Privacy flag enforcement (PrivacyGuard)
Added
PrivacyGuardwith typed guards forsearchEngineIndexing,allowDirectMessages, andallowProfileComments.getPublicProfilenow setsX-Robots-Tagbased on the user's indexing preference. The two message/comment guards are ready to be called by those controllers as those features land.#164 – HTTP integration tests for export and deletion
Added
data-export-http.test.tscovering all 7 routes: auth enforcement, status codes, response envelopes, pagination, authorization isolation between users, and the full deletion lifecycle (schedule → duplicate guard → cancel in-app → cancel via email token → cross-user rejection).Tests added
src/services/__tests__/DataRetentionJob.test.ts(7 tests)src/services/__tests__/PrivacyGuard.test.ts(12 tests)src/controllers/__tests__/data-export-http.test.ts(28 tests)closes #162
closes #163
closes #164