Skip to content

Conversation

@matthewdeaves
Copy link
Owner

No description provided.

Rate Limiting Header Fixes:
- Simplified get_rate_limit_headers function to handle different tuple structures
- Fixed tuple unpacking error in rate limit header extraction
- Made header extraction more resilient to different rate limit data formats
- Maintained consistent header output format across all endpoints

Database Session Handling:
- Modified get_db_session to handle RateLimitExceeded exceptions gracefully
- Added RateLimitExceeded to expected exceptions alongside HTTPException
- Prevented unnecessary error logging for expected rate limit exceptions
- Ensured proper database session cleanup in all scenarios

Test Improvements:
- Simplified rate limit mock in tests to set info before exceptions
- Fixed view_rate_limit tuple structure in tests
- Ensured consistent rate limit data structure across all tests
- Fixed failing tests for no-auth and auth scenarios

These changes improve the reliability of rate limiting, fix database
session handling during rate limit exceptions, and ensure consistent
behavior across all API endpoints while maintaining proper test coverage.
@matthewdeaves matthewdeaves merged commit 7d39305 into main Dec 27, 2024
1 check passed
@matthewdeaves matthewdeaves deleted the adding-tests branch December 27, 2024 14:11
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.

2 participants