Skip to content
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

feat: added logging if user was redirected to any error page with the… #942

Merged
merged 2 commits into from
May 30, 2023

Conversation

web-mi
Copy link
Contributor

@web-mi web-mi commented May 27, 2023

… latest x requests

Fixes #

Proposed Changes

@vi-sudo
Copy link

vi-sudo commented May 27, 2023

Task linked: OB-3716 FE: Login Logging

@what-the-diff
Copy link

what-the-diff bot commented May 27, 2023

PR Summary

  • Added correlationId to API error handling
    Improves API error tracking and debugging by including correlationId.

  • Introduced RequestLog class and requestCollector singleton
    These new additions enable the collection of requests within the frontend, making it easier to monitor and analyze frontend activities.

  • Enhancements to fetchData function
    The function now uses the new RequestLog object and introduces improved error handling, such as timeout and abort handling. It also adds a 520 status code for exceptions during API call execution.

  • Updated DevToolbar component
    Now displays a table of the last 10 requests made by the app, including method, URL, duration, and response status code. It also shows correlationId when available. This makes debugging easier, especially in production environments with limited access to backend logs.

  • Added new requestCollector.ts file
    Defines constants and provides an initial empty array of RequestLogs called "requests."

  • Imported dependencies and constants
    The 'uuid' package is imported for generating unique IDs, and appConfig is imported from the appConfig file. Additionally, the REQUEST_LOGS_LIMIT (10) and REQUEST_COLLECTOR_EVENT ("requestCollector") are exported as constants.

@web-mi web-mi force-pushed the OB-3716 branch 5 times, most recently from 42189b9 to c07adc4 Compare May 27, 2023 22:14
Base automatically changed from OB-RegistrationFix to develop May 30, 2023 08:15
@sonarcloud
Copy link

sonarcloud bot commented May 30, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

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.

3 participants