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

&maxResults=50 causes no issues to be returned on load-balanced environment #260

Closed
evilnerd opened this issue Mar 5, 2020 · 1 comment
Labels

Comments

@evilnerd
Copy link
Contributor

evilnerd commented Mar 5, 2020

When using the method SearchPages, the GET query gets suffixed with &maxResults=50 (by default). This works fine on my standalone Jira server, but not on our load-balanced datacenter edition (multi-node) in which case simply no issues are returned even though the query would normally return several issues.

I tracked the issue down to the Search method, where the &maxResults=50 is added unescaped. By changing the call to: ...&maxResults=50 I could solve the issue (and this keeps working on my single-node instance).

A second, related issue is that when no Jira Issues are returned by the query, the SearchPages method ends in a endless loop.

@evilnerd
Copy link
Contributor Author

evilnerd commented Mar 5, 2020

I have a fix but I'm trying to figure out how to push it here to create pull request.

@evilnerd evilnerd mentioned this issue Mar 5, 2020
7 tasks
@ghostsquad ghostsquad added the bug label Mar 7, 2020
ghostsquad pushed a commit that referenced this issue Mar 15, 2020
When used with a load balanced Jira, the SearchPages method would end
up in an endless loop. This was caused by a bug where Jira would not
handle the MaxResults=50 that is sent by defaul properly, thus retur-
ning no issues. The SearchPages method didn't check for empty results
and ended up in an endless loop.

Fixed this by
1. Pre-escaping '&maxResults' to '&MaxResults'.
2. Adding a check in SearchPages to see if the issues array is empty
   before going into the endless 'for'.

Also fixed the appropriate tests.

Fixes issue #260.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants