Skip to content

fix: Cloud function specific rate limit is ignored when cloud code is loaded at startup#10550

Open
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/cloud-code-rate-limit-clobbered-on-startup
Open

fix: Cloud function specific rate limit is ignored when cloud code is loaded at startup#10550
dblythy wants to merge 1 commit into
parse-community:alphafrom
dblythy:fix/cloud-code-rate-limit-clobbered-on-startup

Conversation

@dblythy

@dblythy dblythy commented Jul 5, 2026

Copy link
Copy Markdown
Member

Closes #8684

Summary by CodeRabbit

  • Bug Fixes
    • Fixed rate limits configured for individual Cloud Functions to be correctly applied when defined in server-side cloud code.
    • Improved loading of rate-limit configuration to ensure the intended settings are used.
    • Requests exceeding a configured function-specific limit now return the expected connection failure.

@parse-github-assistant

Copy link
Copy Markdown

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The rate-limit middleware now resolves string configurations through AppCache, and a regression test verifies that a Cloud Function-specific limit rejects a subsequent invocation with the expected error.

Changes

Cloud Function rate limiting

Layer / File(s) Summary
Rate-limit resolution and regression coverage
src/middlewares.js, spec/RateLimit.spec.js
addRateLimit retrieves string configurations from AppCache; the regression test verifies successful first invocation and rejection of the second invocation for a per-function limit.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: mtrezza


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
Description check ❌ Error Only "Closes #8684" is provided; the required Issue, Approach, and Tasks sections are missing. Fill in the template sections with the issue summary, approach, and task checklist, or explain any omitted items.
Engage In Review Feedback ❓ Inconclusive No review-comment thread evidence is present in the repo diff, so engagement can't be verified from code alone. Provide the PR review conversation or comment history showing the feedback was discussed before resolution.
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title uses the required fix: prefix and clearly matches the cloud-function rate-limit bug.
Linked Issues check ✅ Passed The middleware fix and new test directly address #8684 by enforcing cloud-function rate limits at startup.
Out of Scope Changes check ✅ Passed The diff stays on-issue: one middleware fix and one targeted regression test.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Security Check ✅ Passed Diff only swaps config lookup to AppCache.get for trusted app IDs and adds a test; no new user-controlled sink, auth bypass, or injection path.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.66%. Comparing base (cce91e5) to head (da284f2).
⚠️ Report is 52 commits behind head on alpha.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha   #10550   +/-   ##
=======================================
  Coverage   92.66%   92.66%           
=======================================
  Files         193      193           
  Lines       16981    16981           
  Branches      248      248           
=======================================
  Hits        15736    15736           
  Misses       1224     1224           
  Partials       21       21           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dblythy
dblythy force-pushed the fix/cloud-code-rate-limit-clobbered-on-startup branch from 205b54d to da284f2 Compare July 5, 2026 06:48
@dblythy

dblythy commented Jul 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown
✅ Action performed

Full review finished.

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.

Cloud function specific rate limit is not working

1 participant