Skip to content

Block deleted bundle reads from cache#1

Open
digzrow-coder wants to merge 7 commits into
mainfrom
codex/capgo-deleted-bundle-read-guard
Open

Block deleted bundle reads from cache#1
digzrow-coder wants to merge 7 commits into
mainfrom
codex/capgo-deleted-bundle-read-guard

Conversation

@digzrow-coder
Copy link
Copy Markdown
Owner

Summary

  • Rebase the deleted app-scoped attachment guard onto current main.
  • Block cache/R2 reads when a requested path matches a soft-deleted bundle, a persisted manifest asset, or a deleted manifest-path tombstone.
  • Persist manifest-path tombstones before deleting public.manifest rows so stale cached delta/asset reads stay blocked after manifest cleanup.
  • Keep private download links from resolving deleted bundles.
  • Add indexes/table support for deleted bundle and manifest-path lookups.
  • Add regression coverage for deleted bundle paths, persisted manifest paths, tombstoned manifest paths, local proxy reads, delete cleanup, and non-deleted cached bundle reads.

Supersedes Cap-go#2124 because the original PR branch is owned by a fork I cannot push to from this account.

/claim Cap-go#1667

Test plan

  • bun x vitest run tests/files-app-read-guard.unit.test.ts tests/files-local-read-proxy.unit.test.ts tests/download-link-deleted-bundle.unit.test.ts tests/on-version-update-cleanup.unit.test.ts -> 4 files / 13 tests passed
  • bun x eslint supabase/functions/_backend/files/files.ts supabase/functions/_backend/triggers/on_version_update.ts supabase/functions/_backend/private/download_link.ts tests/download-link-deleted-bundle.unit.test.ts tests/files-app-read-guard.unit.test.ts tests/files-local-read-proxy.unit.test.ts tests/on-version-update-cleanup.unit.test.ts
  • git diff --check

Screenshots

Not applicable; backend-only change.

Checklist

  • My code follows the code style of this project and passes the targeted lint checks listed above.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • My change has adequate E2E test coverage.
  • I have tested my code manually, and I have provided steps how to reproduce my tests.

slashdevcorpse and others added 7 commits May 15, 2026 13:23
Deleted bundle objects can still have a cached response at the edge. Check the app_versions deletion state for the exact app-scoped r2_path before serving cached attachment bytes, so a soft-deleted bundle cannot be read or restored from cache.

Co-authored-by: Codex <noreply@openai.com>
Keep the local read proxy unit test aligned with the app-scoped attachment guard's database lookup by returning an empty app_versions result from the mocked pg client.

Co-authored-by: Codex <noreply@openai.com>
Create a partial app_versions index for deleted R2 paths and cover the non-deleted cached bundle path in the app-scoped read guard tests.

Co-authored-by: Codex <noreply@openai.com>
Extend the deleted bundle guard to manifest asset paths, keep private download links from resolving deleted bundles, and add focused regression coverage for both paths.

Co-authored-by: Codex <noreply@openai.com>
Keep the deleted-bundle download link regression test scoped to local mocks so it does not reset modules during the wider backend suite.

Co-authored-by: Codex <noreply@openai.com>
Also adds the manifest lookup index and updates the read-guard regression to cover persisted manifest assets.\n\nCo-authored-by: Codex <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants