MCPcopy Create free account

hub / github.com/Shankar-105/Social-Media-Api / functions

Functions373 in github.com/Shankar-105/Social-Media-Api

Functionget_recent_chats
( db: AsyncSession = Depends(getDb), currentUser: models.User = Depends(oauth2.getCurrentUser) )
app/messaging/chat_history.py:147
Functionget_reserved_tasks
Get list of reserved tasks (tasks pulled from queue but not yet executed). Returns: List of reserved tasks waiting to execute.
app/routes/celery_tasks.py:99
Functionget_saved_posts
( db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(oauth2.getCurrentU
app/routes/saved.py:99
Functionget_shared_post_reactions
( shared_id: int, db: AsyncSession = Depends(db.getDb), currentUser: models.User = Depends(oauth2.
app/messaging/share_reaction.py:24
Functionget_task_status
Get status and result of a specific task. Returns: - task_id: UUID of the task - status: PENDING, STARTED, RETRY, FAILUR
app/routes/celery_tasks.py:13
Functionget_token
(client, create_test_user)
pytests/conftest.py:316
Functionget_unread_count
Return the count of unread notifications - used for the badge number.
app/services/notification_service.py:142
Functionget_unread_notification_count
( db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(oauth2.getCurrentU
app/routes/notifications.py:65
Functionget_user_avatar
(user_id:int, db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/users.py:82
Functionget_user_posts
(user_id:int, limit:int=Query(10, ge=1, le=100), offset: int = Query(0, ge=0), db:AsyncSession=Depends(db.getD
app/routes/users.py:210
Functionget_user_profile
(user_id:int, db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/users.py:24
Functionget_vote_stats
(db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/me.py:250
Functionget_voted_posts
(db:AsyncSession=Depends(db.getDb), currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/me.py:228
Functionget_worker_stats
Get statistics about all Celery workers. Returns: Worker stats including pool size, processed tasks, total tasks.
app/routes/celery_tasks.py:126
FunctionhashPassword
Hash a password using bcrypt — offloaded to a thread pool to avoid blocking the event loop.
app/utils/thread_helpers.py:27
Functionhealth_check
Comprehensive health check for the API and its dependencies.
app/main.py:206
Functionintegrity_exception_handler
(request: Request, exc: IntegrityError)
app/utils/exception_handlers.py:32
Functionis_blacklisted
Checks if a token is in the Redis blacklist.
app/services/redis_service.py:166
Functionlifespan
(app: FastAPI)
app/main.py:58
FunctionlikeAComment
(commentId:int, comment:sch.CommentVoteRequest=Body(...), db:AsyncSession=Depends(getDb), currentUser:models.U
app/routes/like.py:84
Functionlist_users
(db:AsyncSession=Depends(db.getDb))
app/routes/users.py:123
Functionload_missed_content
( user_id: int, db: AsyncSession=Depends(db.getDb) )
app/messaging/load_missed_msgs.py:11
FunctionloginUser
(userCred:OAuth2PasswordRequestForm=Depends(),db:AsyncSession=Depends(db.getDb),_:None=Depends(login_limiter))
app/routes/auth.py:30
Functionlogout
(token: str = Depends(oauth2.oauth2_scheme), db: AsyncSession = Depends(db.getDb))
app/routes/auth.py:79
Functionmark_all_notifications_read
( db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(oauth2.getCurrentU
app/routes/notifications.py:88
Functionmark_all_read
Bulk-mark every unread notification for a user as read.
app/services/notification_service.py:152
Functionmark_as_read
(payload: dict, reader_id: int, db: AsyncSession)
app/messaging/read_receipt.py:13
FunctionmessageUser
( payload:schemas.MessageSchema, user_id:int, db:AsyncSession )
app/messaging/dm.py:15
Functionmock_db
Mock database session for testing.
pytests/test_cross_process_chat_delivery.py:26
Functionmock_redis_client
Mock Redis client for testing.
pytests/test_cross_process_chat_delivery.py:18
Functionmock_session_factory
()
pytests/test_notification_pubsub.py:30
Functionmsg_reactions
( msg_id:int, db: AsyncSession = Depends(db.getDb), currentUser: models.User = Depends(oauth2.getC
app/messaging/msg_reaction.py:22
FunctionmyProfile
(db:AsyncSession=Depends(db.getDb),currentUser:models.User=Depends(oauth2.getCurrentUser))
app/routes/me.py:26
Functionoperational_error_handler
(request: Request, exc: OperationalError)
app/utils/exception_handlers.py:82
Functionoverride_getDb
()
pytests/conftest.py:273
Functionpurge_queue
Purge all tasks from a specific queue. WARNING: This will delete all pending tasks in the queue! Args: queue_name: Name of queue
app/routes/celery_tasks.py:170
Functionreact
( reaction:schemas.ReactionPayload, user_id:int, db: AsyncSession )
app/messaging/msg_reaction.py:55
Functionreact_to_shared_post
( reaction: schemas.ReactionPayload, user_id: int, db: AsyncSession )
app/messaging/share_reaction.py:57
Functionreconcile_denormalized_counters_task
(self)
app/tasks/reconciliation_task.py:9
Functionrefresh_token
(payload: sch.RefreshTokenRequest = Body(...), db: AsyncSession = Depends(db.getDb), _: None = Depends(refresh
app/routes/auth.py:72
Functionregister_user
(userData:sch.UserSignupRequest=Body(...), db:AsyncSession=Depends(db.getDb), _:None=Depends(signup_limiter))
app/routes/users.py:97
Functionremove_follower_endpoint
(user_id:int, follower_id:int, db: AsyncSession = Depends(getDb), currentUser: models.User = Depends(oauth2.ge
app/routes/connect.py:106
Functionreply_msg
( payload:schemas.ReplyMessageSchema, user_id:int, db:AsyncSession )
app/messaging/reply_msg.py:16
Functionreply_share
( payload:schemas.ReplyToShareSchema, user_id:int, db: AsyncSession )
app/messaging/reply_to_share.py:15
Functionresend_verification_otp
(payload: sch.ResendVerificationOtpRequest, db: AsyncSession = Depends(db.getDb), _: None = Depends(forgot_pas
app/routes/auth.py:178
Functionreset_password
(payload: sch.ResetPasswordSchema, db: AsyncSession = Depends(db.getDb), _: None = Depends(reset_password_limi
app/routes/auth.py:121
Functionreset_password_authenticated
(request:schemas.PasswordResetRequest=Body(...),db:AsyncSession=Depends(db.getDb),currentUser:models.User=Depe
app/routes/changepassword.py:36
Functionrevoke_all_user_tokens
Revoke every refresh token for a user (called on password change).
app/services/token_service.py:121
Functionrevoke_task
Revoke (cancel) a specific task. Args: task_id: UUID of task to revoke terminate: If True, terminate the task if it's cu
app/routes/celery_tasks.py:151
Functionroot_home
()
app/main.py:112
Functionrotate_refresh_token
( db: AsyncSession, old_token_str: str )
app/services/token_service.py:43
FunctionsaveOtp
(db:AsyncSession,email:str,otp:str,minutes:int=2)
app/services/otp_service.py:23
Functionsave_post
( post_id: int, db_session: AsyncSession = Depends(db.getDb), current_user: models.User = Depends(
app/routes/saved.py:44
Functionsearch
(searchParams: sch.SearchRequest = Depends(), db: AsyncSession = Depends(db.getDb), currenUser: models.User =
app/routes/search.py:16
Functionsend_media
( file: UploadFile = File(...), to: int = Form(...), current_user = Depends(oauth2.getCurrentUser)
app/messaging/media_msg.py:23
Functionsend_otp_email
(to_email:str,otp:str)
app/services/email_service.py:21
Functionsend_otp_email
(self, to_email: str, otp: str)
app/tasks/email_tasks.py:8
Methodsend_to_user
(self, message: str, receiver_id: int)
app/utils/socket_manager.py:171
Functionsend_verification_email
(to_email: str, otp: str)
app/services/email_service.py:46
Functionsend_verification_email
(self, to_email: str, otp: str)
app/tasks/email_tasks.py:17
Methodsend_wrapper
(message)
app/utils/observability.py:98
Functionsetup
()
loadtests/load.js:17
Functionsetup
()
loadtests/stress.js:18
Functionsetup
()
loadtests/smoke.js:16
Functionsetup_celery_logging
Ensure Celery workers use structlog.
app/utils/logging.py:107
Functionsetup_test_db
()
pytests/conftest.py:235
Functionshare_post
1. Validate post exists 2. Validate receiver exists & not self 3. Save SharedPost record 4. Push a **preview** to receiver via WebSoc
app/messaging/share.py:26
Functionsqlalchemy_exception_handler
(request: Request, exc: SQLAlchemyError)
app/utils/exception_handlers.py:69
Functiontest_actor_basic_maps_profile_picture_alias
()
pytests/test_edge_cases.py:203
Functiontest_add_comment
(client, get_token)
pytests/test_comments.py:1
Functiontest_can_edit_response_schema
Verify CanEditResponse for edit_msg endpoint
pytests/test_edge_cases.py:118
Functiontest_celery_queue_and_beat_configuration
()
pytests/test_celery_infrastructure.py:37
Methodtest_chat_listener_extracts_receiver_id
Test that _chat_messages_listener extracts receiver_id from payload.
pytests/test_cross_process_chat_delivery.py:289
Functiontest_comment_create_response
Verify comment creation returns CommentDetailResponse
pytests/test_edge_cases.py:145
Functiontest_comment_list_response_schema
Verify comments return proper CommentListResponse
pytests/test_schema_validation.py:96
Functiontest_comment_stats_response_schema
Verify CommentStatsResponse
pytests/test_edge_cases.py:58
Methodtest_connection_manager_ignores_offline_users
Test that ConnectionManager doesn't crash when user is offline.
pytests/test_cross_process_chat_delivery.py:268
Methodtest_connection_manager_offline_doesnt_crash
Test that ConnectionManager doesn't crash for offline users.
pytests/test_cross_process_chat_delivery.py:253
Functiontest_create_notification_falls_back_to_local_send_when_redis_fails
()
pytests/test_notification_pubsub.py:59
Functiontest_create_notification_publishes_to_redis_and_includes_receiver_id
()
pytests/test_notification_pubsub.py:13
Functiontest_create_post
(client, get_token)
pytests/test_posts.py:1
Functiontest_create_post_requires_auth
(client)
pytests/test_posts.py:20
Functiontest_create_post_response_has_core_fields
(client, get_token)
pytests/test_posts.py:25
Functiontest_delete_comment_not_exist
(client, get_token)
pytests/test_comments.py:11
Functiontest_delete_for_everyone_is_single_transition
(db_session_factory, monkeypatch)
pytests/test_concurrency_hardening.py:118
Methodtest_deleted_message_publishes_to_redis
Test that delete_msg.delete_for_everyone publishes to Redis.
pytests/test_cross_process_chat_delivery.py:89
Methodtest_deleted_share_publishes_to_redis
Test that delete_shares.delete_share_for_everyone publishes to Redis.
pytests/test_cross_process_chat_delivery.py:215
Methodtest_direct_message_publishes_to_redis
Test that dm.messageUser publishes to Redis for cross-process delivery.
pytests/test_cross_process_chat_delivery.py:48
Functiontest_end_to_end_cross_process_scenario
Conceptual end-to-end test for cross-process message delivery. Scenario: - User 1 on Process 1 sends message to User 2 - User 2
pytests/test_cross_process_chat_delivery.py:338
Functiontest_error_responses_consistent_format
Verify all error responses follow same format
pytests/test_schema_validation.py:77
Functiontest_feed_response_structure
Verify FeedResponse schema
pytests/test_edge_cases.py:100
Functiontest_follow_is_atomic_under_concurrency
(db_session_factory)
pytests/test_concurrency_hardening.py:156
Functiontest_follow_response_includes_count
Verify follow/unfollow returns FollowResponse with count
pytests/test_schema_validation.py:153
Functiontest_follow_unfollow
(client, get_token)
pytests/test_connections.py:1
Functiontest_get_all_users
(client, get_token)
pytests/test_users.py:11
Functiontest_get_notifications_empty
Fresh test user starts with zero notifications.
pytests/test_notfications.py:3
Functiontest_get_post
(client, get_token)
pytests/test_posts.py:9
Functiontest_invalid_token_returns_401
Verify authentication failures are consistent
pytests/test_edge_cases.py:135
Methodtest_listener_handles_missing_receiver_id
Test that listener gracefully handles messages without receiver_id.
pytests/test_cross_process_chat_delivery.py:303
Functiontest_load_missed_claims_each_message_once
(db_session_factory)
pytests/test_concurrency_hardening.py:85
← previousnext →201–300 of 373, ranked by callers