Problem
get_assertions_by_badge fetches all assertions at once using .all(),
leaving pagination to be handled in Python by consumers like tahrir.
This is inefficient and was flagged in tahrir's codebase as a known issue.
Fix
Add offset and limit params and let SQLAlchemy handle it at the DB level.
Problem
get_assertions_by_badge fetches all assertions at once using .all(),
leaving pagination to be handled in Python by consumers like tahrir.
This is inefficient and was flagged in tahrir's codebase as a known issue.
Fix
Add offset and limit params and let SQLAlchemy handle it at the DB level.