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

Searching for an entry on the web shouldn't take forever #9195

Closed
HoussemNasri opened this issue Oct 1, 2022 · 3 comments · Fixed by #9199
Closed

Searching for an entry on the web shouldn't take forever #9195

HoussemNasri opened this issue Oct 1, 2022 · 3 comments · Fixed by #9199
Assignees
Labels
fetcher good first issue An issue intended for project-newcomers. Varies in difficulty.

Comments

@HoussemNasri
Copy link
Member

Is your suggestion for improvement related to a problem? Please describe.
When searching an entry using web search and the entry is not found, JabRef would keep displaying Processing .

Describe the solution you'd like
There should be a timeout for a search request and after the timeout is passed, JabRef should display a message indicating the query doesn't correspond to any entry.

Additional context
image

@HoussemNasri HoussemNasri added fetcher good first issue An issue intended for project-newcomers. Varies in difficulty. labels Oct 1, 2022
@dominikaxx
Copy link
Contributor

Hi, could you assign the issue to me, please?

@dominikaxx
Copy link
Contributor

This is my first issue on open-source project, I started by studying the code. Any ideas how I should start fixing the issue and setting the timeout for a search request?

@HoussemNasri
Copy link
Member Author

Hello @dominikaxx. For getting started, I suggest you have a look at WebSearchPane, ImportEntries and the fetchers code located under org.jabref.logic.importer.fetcher.

BackgroundTask<ParserResult> task;
task = BackgroundTask.wrap(() -> new ParserResult(activeFetcher.performSearch(query)))
.withInitialMessage(Localization.lang("Processing %0", query));
task.onFailure(dialogService::showErrorDialogAndWait);

The problem seems to reside here, as when the fetcher returns an empty list of entries the message property is not updated. It is kept to Processing <query> .

task.onSuccess(parserResult -> {
// store the complete parser result (to import groups, ... later on)
this.parserResult = parserResult;
// fill in the list for the user, where one can select the entries to import
entries.addAll(parserResult.getDatabase().getEntries());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetcher good first issue An issue intended for project-newcomers. Varies in difficulty.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants