Skip to content

solved : Issue while signin() method on Handling Authentication -> No token was being returned #150

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

CLoaKY233
Copy link

Description

Added missing return statement in the signin() method to return the authentication token.

Problem

The signin() method had a return type annotation of str but wasn't actually returning the token, making it impossible for users to capture the token value directly from the signin() call.

Changes

  • Added return self.token statement to the signin() method

Testing

  • Verified that the token is now properly returned when calling signin()
  • Behavior remains backwards compatible as the token is still stored in self.token

fix: Add missing token return in signin method
@CLoaKY233
Copy link
Author

@maxwellflitton updated upon some more issues,

Description

This PR addresses several issues related to WebSocket connection handling and resource cleanup in both async and blocking connections.

Changes

  1. Added missing token return in signin methods

    • Added return self.token to both async and blocking WebSocket connections
    • Ensures consistent return behavior with method signature
  2. Improved WebSocket connection cleanup

    • Enhanced close() method with proper resource cleanup
    • Added error handling during cleanup
    • Clear references to allow proper garbage collection
    • Handle pinger cleanup if present
  3. Enhanced test robustness

    • Added try-except blocks around DELETE queries in tests
    • Improved tearDown method to ensure proper cleanup
    • Added error handling for cleanup operations

Technical Details

  • Added proper error handling in setUp and tearDown methods
  • Improved resource cleanup in blocking WebSocket connection
  • Enhanced connection state management
  • Added safety checks for socket and pinger cleanup

@CLoaKY233
Copy link
Author

There we go

@tobiemh
Copy link
Member

tobiemh commented Feb 1, 2025

Thanks for this pull request @CLoaKY233 . I'm goin to close this as a number of issues have been fixed in #151 and #152 🚀

@tobiemh tobiemh closed this Feb 1, 2025
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