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

Connect to new endpoint for fetching specifically task markers #2356

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

CollinBeczak
Copy link
Collaborator

@CollinBeczak CollinBeczak commented Jun 3, 2024

resolves: #2354
Paired with and dependent on: maproulette/maproulette-backend#1130

Issue: The old endpoint used for fetching task markers was needlessly complex and slow.

This PR connect to the simpler endpoint used to fetch specifically marker data.

@codecov-commenter
Copy link

codecov-commenter commented Jun 3, 2024

Codecov Report

Attention: Patch coverage is 2.38095% with 41 lines in your changes missing coverage. Please review.

Project coverage is 23.47%. Comparing base (cb886ce) to head (cd66497).

Files Patch % Lines
src/services/Task/BoundedTask.js 2.43% 27 Missing and 13 partials ⚠️
...ChallengeTaskClusters/WithChallengeTaskClusters.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2356      +/-   ##
==========================================
- Coverage   23.51%   23.47%   -0.04%     
==========================================
  Files         649      649              
  Lines       22502    22543      +41     
  Branches     6928     6962      +34     
==========================================
+ Hits         5292     5293       +1     
- Misses      14398    14425      +27     
- Partials     2812     2825      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@CollinBeczak CollinBeczak force-pushed the connect-to-new-endpoint-for-fetching-specifically-task-markers branch from 6d15d50 to 6d12185 Compare July 15, 2024 21:19
@CollinBeczak CollinBeczak marked this pull request as ready for review July 19, 2024 22:10
@CollinBeczak CollinBeczak marked this pull request as draft August 6, 2024 20:41
@CollinBeczak CollinBeczak marked this pull request as ready for review August 6, 2024 20:43
@CollinBeczak CollinBeczak force-pushed the connect-to-new-endpoint-for-fetching-specifically-task-markers branch from 1ec4d33 to cd66497 Compare August 9, 2024 21:39
@CollinBeczak CollinBeczak force-pushed the connect-to-new-endpoint-for-fetching-specifically-task-markers branch from cd66497 to 7054879 Compare November 15, 2024 19:11
@CollinBeczak CollinBeczak marked this pull request as draft November 15, 2024 19:12
@CollinBeczak CollinBeczak force-pushed the connect-to-new-endpoint-for-fetching-specifically-task-markers branch from 7054879 to f231806 Compare November 15, 2024 19:13
@CollinBeczak CollinBeczak marked this pull request as ready for review November 15, 2024 21:20
Copy link
Contributor

@jake-low jake-low left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some suggestions on how to simplify the code and reduce dependence on Lodash.

src/services/Task/BoundedTask.js Outdated Show resolved Hide resolved
src/services/Task/BoundedTask.js Outdated Show resolved Hide resolved
src/services/Task/BoundedTask.js Outdated Show resolved Hide resolved
src/services/Task/BoundedTask.js Outdated Show resolved Hide resolved
// If we are searching within map bounds we need to ensure the parent
// challenge is also within those bounds
if (filters.location === CHALLENGE_LOCATION_WITHIN_MAPBOUNDS) {
if (_isArray(criteria.boundingBox)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Array.isArray() would work here

src/services/Task/BoundedTask.js Outdated Show resolved Hide resolved
src/services/Task/BoundedTask.js Outdated Show resolved Hide resolved
Comment on lines 137 to 140
return {
tasks,
totalCount
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does fetchBoundedTaskMarkers need to return both the array of tasks and the array's length? Seems redundant.

* criteria, which should at least include a boundingBox field, and may
* optionally include a filters field with additional constraints
*/
export const fetchBoundedTaskMarkers = function(criteria, limit = 50, skipDispatch = false, ignoreLocked = true) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: you can write export function fetchBoundedTaskMarkers(criteria, ...) { instead; it's shorter.

CollinBeczak and others added 2 commits December 3, 2024 13:06
@CollinBeczak CollinBeczak marked this pull request as draft December 3, 2024 19:07
@CollinBeczak CollinBeczak requested a review from jake-low December 3, 2024 20:05
@CollinBeczak CollinBeczak marked this pull request as ready for review December 3, 2024 20:05
Copy link
Contributor

@jake-low jake-low left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for making the changes I suggested

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

Successfully merging this pull request may close these issues.

fix slow task marker related endpoint calls
3 participants