Patched API Issue#14
Merged
JayNightmare merged 17 commits intorollbackfrom Oct 10, 2025
Merged
Conversation
…trics API - Introduced new API functions to fetch user profile, streak data, and language durations. - Updated DiscordCodingViewProvider to handle user profile and metrics more gracefully. - Removed deprecated functions related to Discord ID handling and username fetching. - Enhanced error handling for API calls to improve user experience. - Updated HTML content generation to reflect new user data structure. Refactor API client and token management - Created a new API client for handling requests with automatic token refresh. - Introduced base URL management for API endpoints. - Simplified token management with better error handling and state management. - Removed legacy code related to direct API token handling from the previous implementation. Implement session queue for managing coding session data - Added a session queue to handle coding session submissions with retries. - Implemented a flushing mechanism to periodically send queued sessions to the server. - Ensured that session data is stored and managed efficiently within the extension's global state. General code cleanup and organization - Removed unused imports and functions across various modules. - Improved code readability and maintainability by restructuring and organizing files.
- Updated formatting and indentation across multiple files for better readability. - Refactored SessionQueue class to streamline enqueue and flush methods. - Enhanced error handling in API utility functions. - Improved configuration management with consistent method signatures. - Optimized language detection logic in timeTracker module. - Added detailed logging for session start and end events. - Ensured proper disposal of resources in session management.
… authentication, API client, session management, and panel data handling
New Auth System
…onfiguration files and documentation
… link API response handling and improve code consistency
…t verifyLinkCode function for improved link verification process
…etailed user information and adjust related function calls
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request is a major update that refactors and improves authentication, API client architecture, session management, and user data handling for the DisTrack VSCode extension. It introduces new modules for token management and API interaction, implements a robust session queue, and updates the extension's metadata and dependencies to reflect these changes. The result is a more reliable, scalable, and maintainable codebase, with clearer logic and improved error handling throughout the extension.
Authentication & Token Management
src/auth/tokenManager.tsto securely manage device IDs, access and refresh tokens, and handle token refresh logic, replacing previous global state usage. Device IDs are now generated and persisted using UUIDs for uniqueness.API Client & Endpoint Abstractions
src/api/client.tsfor centralized, authenticated API requests with automatic token refresh and error handling.src/api/baseUrl.tsto dynamically resolve the API base URL from an asset file, supporting flexible deployments.src/api/link.tsto handle the user linking flow with the backend.Session Data Management
src/sessions/sessionQueue.ts, a persistent queue for session data with periodic flushing and retry logic, improving resilience against connectivity issues.Panel & User Data Refactor
src/panel.tsto use the new profile API, loading all user data (profile, leaderboard, streak, languages) via the new modules, and updated the UI logic to reflect these changes.Dependencies & Extension Metadata
dis-tracktodistrackinpackage.jsonand related documentation, updated display names, and bumped the version to0.9.6. Added dependencies foruuid,@types/uuid, and updated marketplace and packaging references. [1] [2] [3] [4] [5] [6] [7] [8]