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

Option for Verbose Debug Log Messages (in Production) #40

Open
maltfield opened this issue Jul 20, 2022 · 3 comments
Open

Option for Verbose Debug Log Messages (in Production) #40

maltfield opened this issue Jul 20, 2022 · 3 comments

Comments

@maltfield
Copy link

Feature request:

  1. Allow the user to enable verbose debug logging in the main build (ie shouldn't require recompiling the app; it should just be a toggle button or change to about:config at runtime)
  2. Update this project's documentation describing how the user can enable and view the extension's debug log messages

Problem

Problem: There is currently no way (at least that's easy to find) to enable verbose debug logging so that a user can figure out what failed when this extension doesn't work as expected.

I needed to sign a document today (PIN2) on an Estonian government website, but it failed. I got a very unhelpful error message displayed in the browser:

Signing failed. Please make sure the ID-card software is installed and updated and web browsers are configured correctly. Further guidance

I'm 100% sure that the ID software is installed and my smartcard is recognized by my browser (and this extension) because I used it to sign-into the portal (PIN1). I tried it again in another tab and confirmed that, yes, it's still connected and working (again PIN1).

I tried to sign the document again (PIN2), and got the same unhelpful message in the browser.

I checked the browser's debugging console, but nothing was there. I checked the network tab, and all requests were 200.

I tried downloading the document and opening it for signing locally in qdigidoc4, and when I tried to sign the doc, I got a dreaded Segmentation Fault

Is this extension failing for the same reason? Is it also caused by a segfault? Or is it some backend API failing because of the segfault? I have no idea because I cannot view any log messages to see what is going on under the hood.

Solution

This tool needs a way for the user to be able to enable and view very, very detailed debug log messages so that they can pinpoint issues and submit bug reports or pull requests.

@maltfield
Copy link
Author

Originally filed here.

I think both are relevant and important (all apps at every stage of the architecture should have some --debug option to allow the user to see what's failing under the hood), but this is probably the most likely repo where debug logs will help to solve my related woes.

@maltfield maltfield changed the title Verbose Debug Log Messages (in Production) Option for Verbose Debug Log Messages (in Production) Jul 20, 2022
@taneltm
Copy link
Member

taneltm commented Nov 10, 2022

Sorry for not replying sooner @maltfield

A toggle button would require either an extension page or an extension menu. Adding those would be fine if we had other settings a user could tweak, but we don't.
An about:config option sounds better, but you can't add custom options and a browser extension is not able to read those options anyway.

But we could include a global DEBUG property, which on-access would enable the debug logs.
For the content script, you would first need to open the website's DevTools and switching the console to the Web-eID context.
For the background script, you would need to open the background script inspector.

  • For Chrome you'd first need to enable the "developer mode" on the extensions page.
  • For Firefox you need to open the about:debugging#/runtime/this-firefox page.

Then typing DEBUG in the console would enable the debug messages.
For the content script you would have to repeat the steps after a page reload, but that's probably not a big issue.

@maltfield
Copy link
Author

maltfield commented Nov 10, 2022

As long as it's very clearly documented showing how to enable and view the debug logs in all relevant browsers (with a video demo or at least screenshots), I think that solution is fine.

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

No branches or pull requests

2 participants