- Introduced TelegramProvider to manage the Telegram MTProto connection, handling initialization and connection status updates.
- Refactored TelegramConnectionModal to remove unused authStatus selector, streamlining the component.
- Enhanced MTProtoService with FLOOD_WAIT handling for connection checks and message sending, improving reliability during Telegram interactions.
- Updated telegramSlice to prevent concurrent authentication checks, optimizing performance during user authentication.
These changes enhance the application's ability to manage Telegram connections effectively, providing a smoother user experience during authentication and interaction.
- Introduced TelegramConnectionIndicator component to display real-time connection status to Telegram, enhancing user feedback.
- Integrated TelegramConnectionIndicator into the Home component, providing users with immediate visibility of their Telegram connection status.
- Updated App component to include TelegramProvider, ensuring proper context for the new connection indicator.
These changes improve the user experience by providing clear indications of Telegram connectivity within the application.
- Enhanced the TelegramConnectionModal to provide better management of the 2FA password input process, including timeout handling and improved error messaging.
- Updated MTProtoService to ensure proper handling of SESSION_PASSWORD_NEEDED errors, allowing the password callback to manage authentication flow more effectively.
- Added logging for password resolution and authentication status checks to improve visibility during the connection process.
These changes enhance the reliability and user experience of the Telegram authentication process, ensuring smoother transitions and clearer feedback during authentication steps.
- Introduced polyfills for Node.js globals (Buffer, process, util) to support Telegram package functionality in the browser.
- Updated Vite configuration to include node polyfills, ensuring compatibility with Node.js APIs.
- Enhanced TelegramConnectionModal to manage connection states, including loading and error handling, improving user experience during authentication.
- Implemented QR code generation and handling for Telegram login, with robust error management and user feedback.
These changes establish a solid foundation for Telegram integration, enhancing the application's ability to handle real-time communication and user authentication effectively.
- Introduced MTProtoService for managing Telegram client initialization, connection, and message handling.
- Created telegramSlice for Redux state management, including connection and authentication states, user data, chats, messages, and threads.
- Implemented asynchronous actions for initializing the Telegram client, connecting, checking authentication status, and fetching chats and messages.
- Enhanced configuration utility to include Telegram API credentials for improved integration.
These changes establish a robust foundation for Telegram functionality within the application, enhancing user experience and state management.
- Updated SocketProvider to ensure the socket disconnects only when the app unmounts and no valid token exists, preventing unnecessary disconnections during re-renders.
- Enhanced logging for socket connection and disconnection events to provide better insights into socket state management.
- Refactored socket connection options in SocketService for improved reliability and security, including explicit handling of token in the handshake.
These changes enhance the application's real-time communication capabilities and improve the overall management of socket connections.
- Added console logs in SocketProvider for token connection and disconnection events, improving debugging visibility.
- Updated SocketService to include detailed logging for connection attempts, token changes, and error handling, enhancing traceability during socket operations.
- Refactored socket connection logic to ensure proper handling of existing connections and improved error messaging for authentication failures.
These changes improve the application's real-time communication capabilities and provide better insights into socket connection states.
- Introduced UserProvider to automatically fetch user data when a JWT token is available, enhancing user experience by ensuring data is readily accessible.
- Created useUser hook for accessing user data and managing loading states, streamlining the process of fetching and utilizing user information.
- Implemented userSlice for managing user state in Redux, including actions for fetching and clearing user data, improving state management consistency.
- Added apiClient for handling API requests, including error handling and authentication, to facilitate communication with the backend.
These changes enhance the application's user data management and improve the overall architecture by integrating user state with Redux.
- Replaced direct route definitions in the App component with a new AppRoutes component for improved organization and maintainability.
- Introduced SocketProvider to manage socket connections based on JWT token, enhancing real-time communication capabilities.
- Updated the useSocket hook to rely on Redux state for connection status, streamlining socket management.
These changes enhance the application's architecture by separating concerns and improving the overall structure of routing and socket management.
- Added Redux Toolkit for managing authentication state, replacing Zustand for token handling.
- Implemented authSlice for token management, including setting and clearing tokens with localStorage synchronization.
- Refactored components (Login, Home, TelegramLoginButton) to utilize Redux for token management, enhancing state consistency.
- Updated App component to include Redux Provider and PersistGate for state persistence.
- Removed Zustand-based authStore and socketStore, streamlining the state management approach.
These changes improve the application's architecture by centralizing state management with Redux, enhancing maintainability and scalability.
- Introduced a new Zustand store for managing socket connection status and socket ID, improving state management for real-time communication.
- Updated the ConnectionIndicator component to utilize the socket store for dynamic status updates, allowing for better integration with the socket connection state.
- Enhanced the SocketService class to update the socket connection status during various connection events, ensuring accurate status reporting.
- Refactored the TelegramLoginButton component to clarify JWT token handling in comments, improving code readability.
These changes enhance the application's real-time capabilities and provide a more robust user experience by accurately reflecting connection states.
- Introduced a new useSocket hook for managing Socket.IO connections in React components, providing methods for emitting and listening to events.
- Created a socketService class to handle the Socket.IO connection, including automatic reconnection and event management.
- Implemented token-based authentication for socket connections using the Zustand auth store, ensuring secure communication with the server.
- Added event handlers for connection status and error management to enhance reliability.
These changes enable real-time communication capabilities in the application, improving user interaction and responsiveness.