8000 fix: isolate website limits and scope explorer counts by tdurieux · Pull Request #920 · tdurieux/anonymous_github · GitHub
[go: up one dir, main page]

Skip to content

fix: isolate website limits and scope explorer counts - #920

Merged
tdurieux merged 2 commits into
mainfrom
fix/website-budgets-folder-counts
Nov 3, 2026
Merged

tdurieux merged 2 commits into
mainfrom
fix/website-budgets-folder-counts

Conversation

@tdurieux
@tdurieux tdurieux commented Nov 3, 2026 •
Copy link
Copy Markdown
Owner

Image-heavy project pages can exhaust a visitor's shared API allowance, leaving both assets and API requests rate-limited. Large repositories also lose folder counts when the explorer asks for a repository-wide map exceeding the memory guard.

Give /w/ its own Redis-backed visitor budget, configurable with WEBSITE_RATE_LIMIT and defaulting to 2,000 requests per 15 minutes. Keep the existing website slowdown, trusted-proxy identity, access checks, and API limits. Folder counts now load once per directory after its listing, returning only that folder and its immediate children from the active tree. Responses stay bounded and the aggregation has a two-second deadline. Browsing continues without unavailable badges after a count failure, without repeated count retries or presenting loaded entries as the total file count. Legacy callers without a scope retain the existing guarded response.

Validation:

  • Production build and lint pass.
  • 36 request-budget, proxy, and MongoDB count tests pass, including 12,000 nested folders, anonymized collisions, generation replacement, dollar-prefixed paths, and over-wide responses.
  • 139 existing large-tree and MongoDB lifecycle regressions pass, including the two-million-entry memory fixture.
  • Viewer and asset-build tests cover lazy counts, 413/429/503 fallback, navigation races, and folder reopening.
  • Desktop/mobile preview checked against a mocked count failure.

Root counts still scan the active subtree in MongoDB; this change bounds results and database execution time rather than making recursive counting constant-time. No production changes or index migration required.

@tdurieux
tdurieux commented Nov 3, 2026
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
chatgpt-codex-connector Bot commented Nov 3, 2026 •
Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T15:11:25.837404Z 7ffbfd0 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4b9fd85e7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/core/folder-counts.ts Resolved
@tdurieux
tdurieux commented Nov 3, 2026
Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 7ffbfd09d7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@tdurieux
tdurieux merged commit b98c2c0 into main Nov 3, 2026
4 checks passed
@tdurieux
tdurieux deleted the fix/website-budgets-folder-counts branch November 3, 2026 15:36
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.

1 participant

0