There is a bug with the purge incomplete tasks switch for the maproulette upload command. When this switch is true a statusFilters parameter is added to the shared url builder used in MapRouletteConnection. This addition persists and increases every time a task is deleted by the purgeIncompleteTasks method. The result is that urls start to look like the following:
When extreme enough, this can cause upload failures due to a maximum url length being hit.
To fix this MapRouletteConnection will no longer share a url builder, but will instead be supplied a new one for each api call.
Potential Impact:
Should only effect the MR commands.
Unit Test Approach:
None, as the project does not have PowerMock. So unit tests for MapRouletteConnection are not viable.
Test Results:
Tested running the command 3 times. The first time was just to upload some data to a project.
The second time the same data was uploaded to the same project with purge incomplete tasks on, and no code changes. This resulted in the final API call having the url tail POST /api/v2/tasks?statusFilters=0%2C3&statusFilters=0%2C3&statusFilters=0%2C3&statusFilters=0%2C3.
The third time was the same as the second, but with the code changes in this PR. The final API call this time has the url tail POST /api/v2/tasks.
Description:
There is a bug with the purge incomplete tasks switch for the maproulette upload command. When this switch is true a
statusFilters
parameter is added to the shared url builder used in MapRouletteConnection. This addition persists and increases every time a task is deleted by the purgeIncompleteTasks method. The result is that urls start to look like the following:When extreme enough, this can cause upload failures due to a maximum url length being hit.
To fix this MapRouletteConnection will no longer share a url builder, but will instead be supplied a new one for each api call.
Potential Impact:
Should only effect the MR commands.
Unit Test Approach:
None, as the project does not have PowerMock. So unit tests for MapRouletteConnection are not viable.
Test Results:
Tested running the command 3 times. The first time was just to upload some data to a project. The second time the same data was uploaded to the same project with purge incomplete tasks on, and no code changes. This resulted in the final API call having the url tail
POST /api/v2/tasks?statusFilters=0%2C3&statusFilters=0%2C3&statusFilters=0%2C3&statusFilters=0%2C3
. The third time was the same as the second, but with the code changes in this PR. The final API call this time has the url tailPOST /api/v2/tasks
.