Skip to content
This repository was archived by the owner on Jul 27, 2025. It is now read-only.

Conversation

@julianojulio
Copy link
Contributor

This PR introduces changes to significantly relax API rate limits for self-hosted instances of Maybe Finance, while preserving the current limits for the SaaS version.

Rationale
When importing a large number of transactions via the API in a self-hosted environment, the existing rate limits quickly become a bottleneck. This change enables power users and integrators to perform bulk imports and other high-frequency operations without being blocked by rate limiting, while ensuring that SaaS users remain protected from abuse.

Key changes

  • Added NoopApiRateLimiter to effectively disable API rate limiting for self-hosted mode.
  • Updated ApiRateLimiter to delegate to NoopApiRateLimiter when running self-hosted.
  • Increased Rack::Attack throttle limits for self-hosted deployments.
  • Added tests for NoopApiRateLimiter to ensure correct behavior.

Impact

  • Self-hosted users can make a much higher volume of API requests without restriction.
  • SaaS users continue to be protected by the existing rate limits.
  • No impact on existing SaaS deployments or their security.

Use case:
I'm working on a project (soon open source) to import my transactions to Maybe Finance using the API. The current rate limits are blocking the import after a few imports. These changes keep the current rate limits for SaaS while relaxing them

Copy link
Collaborator

@zachgoll zachgoll left a comment

Choose a reason for hiding this comment

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

Changes make sense to me! If you could get all tests / checks passing we can merge.

@julianojulio julianojulio force-pushed the julianojulio/relax-rate-limits-for-self-hosted branch 4 times, most recently from 16519cc to 54c3cd2 Compare July 20, 2025 23:54
- Introduced NoopApiRateLimiter to effectively disable API rate limiting for self-hosted mode.
- Updated ApiRateLimiter to delegate to NoopApiRateLimiter when running self-hosted.
- Increased Rack::Attack throttle limits significantly for self-hosted deployments.
- Added tests for NoopApiRateLimiter to ensure correct behavior.
- This allows self-hosted users to make more API requests without restriction, while keeping stricter limits for SaaS deployments.
@julianojulio julianojulio force-pushed the julianojulio/relax-rate-limits-for-self-hosted branch from 54c3cd2 to 04e508c Compare July 21, 2025 00:59
@zachgoll zachgoll merged commit 3f92fe0 into maybe-finance:main Jul 23, 2025
5 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants