Skip to content

#fix Fix/session asynchrone #28#30

Merged
Baptiste-Ferrand merged 6 commits into
developfrom
fix/session-asynchrone-#28
Aug 10, 2025
Merged

#fix Fix/session asynchrone #28#30
Baptiste-Ferrand merged 6 commits into
developfrom
fix/session-asynchrone-#28

Conversation

@Baptiste-Ferrand
Copy link
Copy Markdown
Contributor

@changelog

Changes Made

Async Conversion Only

  • Converted all router functions to async - Changed def to async def for all endpoint functions
  • Added await to service calls - Added await keywords to all service method calls
  • Preserved all dependencies exactly - No changes to authentication, authorization, or role-based access controls
  • Maintained container pattern - Routers continue using container.get_*_service() as originally designed

What Was NOT Changed

  • No dependency modifications - All dependencies=[Depends(...)] declarations remain identical
  • No auth pattern changes - Authentication and authorization logic preserved exactly
  • No security endpoint modifications - Role access controls remain unchanged
  • No architectural changes - Container injection pattern maintained as-is

Technical Details

The conversion involved only:

  1. Function signature changes: def function_name()async def function_name()
  2. Service call changes: service.method()await service.method()
  3. Repository call changes: service._repo.method()await service._repo.method()

All dependency parameters, authentication requirements, and authorization patterns remain exactly as they were before the async conversion.

Example

Before:

@router.get("", dependencies=[Depends(get_current_user)])
def get_exercises(user=Depends(get_current_user)):
    service = container.get_exercise_service()
    exercises = service.get_all_exercises()
    return [ExerciseRead.model_validate(e) for e in exercises]

After:

@router.get("", dependencies=[Depends(get_current_user)])
async def get_exercises(user=Depends(get_current_user)):
    service = container.get_exercise_service()
    exercises = await service.get_all_exercises()
    return [ExerciseRead.model_validate(e) for e in exercises]

@Baptiste-Ferrand Baptiste-Ferrand self-assigned this Aug 10, 2025
@Baptiste-Ferrand Baptiste-Ferrand added bug Something isn't working task A Specific peace of work labels Aug 10, 2025
@Baptiste-Ferrand Baptiste-Ferrand merged commit 64e7799 into develop Aug 10, 2025
2 checks passed
@Baptiste-Ferrand Baptiste-Ferrand deleted the fix/session-asynchrone-#28 branch August 10, 2025 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working task A Specific peace of work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant