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

Improve error handling for browser extension #8432

Merged
merged 7 commits into from
Jan 24, 2022
Merged

Conversation

tobiasdiez
Copy link
Member

Still needs similar changes for the other problems and then some changes to the browser extension to actually show the error.

  • Change in CHANGELOG.md described in a way that is understandable for the average user (if applicable)
  • Tests created for changes (if applicable)
  • Manually tested changed features in running JabRef (always required)
  • Screenshots added in PR description (for UI changes)
  • Checked documentation: Is the information available and up to date? If not, I created an issue at https://github.com/JabRef/user-documentation/issues or, even better, I submitted a pull request to the documentation repository.

@LyzardKing
Copy link
Collaborator

Looks good!
I'll check it properly, and see if something is necessary for the extension to log in the console. It might be an idea to show an alert for the user in the poup window.

@tobiasdiez tobiasdiez changed the title Improve error handling in python script Improve error handling for browser extension Jan 22, 2022
@tobiasdiez
Copy link
Member Author

This is now ready for review. Linux and Macos changes are not tested however.

@tobiasdiez tobiasdiez marked this pull request as ready for review January 23, 2022 13:13
@tobiasdiez tobiasdiez added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Jan 23, 2022
@Siedlerchr
Copy link
Member

What needs to be done to test this?

@tobiasdiez
Copy link
Member Author

The important part would be to install this version and see if the browser extension still works.

If you want to verify the improvements of this PR, then best change cmd = str(JABREF_PATH).split() + ["--importBibtex", r"{}".format(data)] to something that returns with an error code and then check the browser console that the error is displayed there.

@Siedlerchr
Copy link
Member

Siedlerchr commented Jan 23, 2022

Tested the binaries from this PR and it still works under mac. (tested with arxiv)
browser console says


JabRef: Got task to convert  
Array [ {…} ]
​
length: 0
​
<prototype>: Array []
  to BibTeX bibtexConverter.js:240:11
JabRef: Converting item(s) to BibTeX:  
Array [ {…} ]

@LyzardKing
Copy link
Collaborator

It works on Linux as well. I tested it with firefox and it works, with the correct webpage if it fails to find the native messaging info.
Great job!
I'll test it on other browsers later, but I assume it works there as well 😄

@tobiasdiez
Copy link
Member Author

Thanks for testing!

I take this as a positive review ;-)

@tobiasdiez tobiasdiez merged commit e4e32c6 into main Jan 24, 2022
@tobiasdiez tobiasdiez deleted the extension_python_error branch January 24, 2022 15:56
Siedlerchr added a commit that referenced this pull request Jan 25, 2022
* upstream/main:
  Bump h2-mvstore from 2.0.206 to 2.1.210 in /buildSrc (#8458)
  Bump mariadb-java-client from 2.7.4 to 2.7.5 (#8457)
  Bump com.github.andygoossens.modernizer from 1.6.1 to 1.6.2 (#8459)
  Bump mockito-core from 4.2.0 to 4.3.0 (#8460)
  Bump xmlunit-matchers from 2.8.3 to 2.8.4 (#8461)
  Improve error handling for browser extension (#8432)
Siedlerchr added a commit that referenced this pull request Jan 28, 2022
* upstream/main: (24 commits)
  Support CrossRef in CSL styles (#8454)
  Update FUNDING.yml (#8473)
  Update to Javafx 17.02 (#8470)
  Made search button in Web search wider. Also skewed side panel titles to the left (#8463)
  Bump h2-mvstore from 2.0.206 to 2.1.210 in /buildSrc (#8458)
  Bump mariadb-java-client from 2.7.4 to 2.7.5 (#8457)
  Bump com.github.andygoossens.modernizer from 1.6.1 to 1.6.2 (#8459)
  Bump mockito-core from 4.2.0 to 4.3.0 (#8460)
  Bump xmlunit-matchers from 2.8.3 to 2.8.4 (#8461)
  Improve error handling for browser extension (#8432)
  New Crowdin updates (#8451)
  Fix library tab exception when saving prefs (#8450)
  Rename Groups interface into Groups (#8449)
  New Crowdin updates (#8445)
  update snap url
  Update bug_report.yml for 5.5
  Show development information\n\n+semver: minor
  Release v5.5
  Update journal abbrev list
  New Crowdin updates (#8439)
  ...
@Tobi0
Copy link
Contributor

Tobi0 commented Jul 7, 2022

I suspect there is a problem in the buildres/windows/JabRefHost.bat pwsh check for the case: pwsh not installed, powershell.exe installed.

https://github.com/JabRef/jabref/pull/8432/files#diff-e652989be8342b186ecf6bdf200fd7e9ce3e0b75dca438bd2f6c52bcd11b0c6c
If the command where /q pwsh.exe goes wrong, the errorlevel is maybe still 1 after the powershell.exe test. I could not reproduce this in the console but the behavior in the file might be different.

Anyhow if I test the JabRefHost.bat I get

PS C:\Program Files\JabRef> .\JabRefHost.bat
"Could not find pwsh.exe or powershell.exe"
"Please install PowerShell and try again."

(But the where /q powershell.exe command alone does not return an error.)

This would explain why the Browser extension is not working for me.

@Siedlerchr
Copy link
Member

@Tobi0 Feel free to create a PR if you have a idea how to solve this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants