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: add interface to view logs #115

Merged
merged 12 commits into from
Dec 2, 2022
Merged

Conversation

alixlahuec
Copy link
Owner

@alixlahuec alixlahuec commented Nov 30, 2022

Description

Create a custom logging system accessible to users, to assist with debugging issues:

  • BE: ZoteroRoamLog class and logs property in ZoteroRoam
    • Methods called in catch blocks + ErrorBoundary
    • Axios errors are scrubbed to avoid logging API keys or other personal information
  • FE: Logger dialog component, with paginated and filtered output
    • Available through the extension icon's context menu

Validation

✅ Unit testing for class constructor & methods
✅ Storybook testing for Logger
✅ Manual testing (dev build):

  • Trigger a data error, e.g by using a wrong library ID
  • The extension icon is in error state - the extension continues to function otherwise,
  • The errors are visible in the logger & sorted by timestamp

@linear
Copy link

linear bot commented Nov 30, 2022

RM-50 Add custom logger UI

Problem

When a user encounters a data issue, the details aren't visible anywhere. If it's not a request issue, there'll be nothing in the devtools, and nothing in the UI. It's really hard to debug.

Work

  1. Add custom logger and push all the fetch_ errors there (more sources can be added if relevant):

    • Type: "Request"|…
    • Error
    • Context
    • Timestamp
  2. Create UI that displays the logs (icon popover or context menu → error logs)

    • with the Type
    • with the Context

@alixlahuec alixlahuec changed the base branch from main to beta November 30, 2022 05:39
@codecov-commenter
Copy link

codecov-commenter commented Dec 1, 2022

Codecov Report

Merging #115 (656185c) into beta (cbf616b) will increase coverage by 0.09%.
The diff coverage is 91.40%.

❗ Current head 656185c differs from pull request most recent head a3c7bad. Consider uploading reports for the commit a3c7bad to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##             beta     #115      +/-   ##
==========================================
+ Coverage   86.64%   86.72%   +0.09%     
==========================================
  Files         120      122       +2     
  Lines        3958     4035      +77     
  Branches     1135     1151      +16     
==========================================
+ Hits         3429     3499      +70     
- Misses        514      521       +7     
  Partials       15       15              
Impacted Files Coverage Δ
src/components/Errors/ErrorBoundary.jsx 63.64% <0.00%> (-6.36%) ⬇️
src/smartblocks.js 94.24% <ø> (ø)
src/components/Logger/index.jsx 82.15% <82.15%> (ø)
src/api/utils.js 92.61% <94.45%> (+0.34%) ⬆️
src/components/ExtensionIcon/index.jsx 85.72% <100.00%> (ø)
src/components/Logger/LogEntry/index.jsx 100.00% <100.00%> (ø)
src/extension.js 98.24% <100.00%> (+0.19%) ⬆️
src/propTypes.js 100.00% <100.00%> (ø)
src/setup.js 100.00% <100.00%> (ø)
src/utils.js 95.49% <100.00%> (ø)

@alixlahuec alixlahuec marked this pull request as ready for review December 2, 2022 03:50
@alixlahuec alixlahuec merged commit 5224b0e into beta Dec 2, 2022
@alixlahuec alixlahuec deleted the feature/rm-50-add-custom-logger-ui branch December 2, 2022 03:50
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