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

[BUG] Continue button is disabled after fetching OSM labels #334

Open
jeafreezy opened this issue Feb 22, 2025 · 0 comments
Open

[BUG] Continue button is disabled after fetching OSM labels #334

jeafreezy opened this issue Feb 22, 2025 · 0 comments
Assignees

Comments

@jeafreezy
Copy link
Collaborator

Describe the bug
Ideally, after fetching OSM labels, the users should be able to proceed to the next step; however, sometimes it gets buggy, and this button gets disabled.

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://fair-dev.hotosm.org/ai-models/365/training-area
  2. Login if you haven't already.
  3. Draw a new training area.
  4. Click on the map icon to fetch OSM labels.
  5. You will notice that the 'CONTINUE' button is disabled.

Expected behavior
The continue button should be enabled after fetching training labels for all training areas.

Screenshots
Unfortunately, I can not reproduce this on my computer. However, I once experienced this before and during user testing.

Desktop:

  • OS: Mac M3 Pro
  • Browser: I once experienced this on Chrome.

Additional context

The logic that enables the continue button in the training area page happens here:

} else if (currentPath.includes(MODELS_ROUTES.TRAINING_AREA)) {
return (
hasLabeledTrainingAreas && hasAOIsWithGeometry && formData.oamBounds
);

where:

// Confirm that all the training areas labels has been retrieved
const hasLabeledTrainingAreas =
formData.trainingAreas.length > 0 &&
formData.trainingAreas.filter(
(aoi: TTrainingAreaFeature) => aoi.properties.label_fetched === null,
).length === 0;
// Confirm that all of the training areas has a geometry
const hasAOIsWithGeometry =
formData.trainingAreas.length > 0 &&
formData.trainingAreas.filter(
(aoi: TTrainingAreaFeature) => aoi.geometry === null,
).length === 0;

Two things could be the reason for the bug:

  1. The formData is not updated after successfully pooling the task because after pooling, a prefetch is done to get the training areas with their latest properties (especially aoi.properties.label_fetched should change to 1 from null).
  2. The formData is updated, but the backend has not updated the label fetched status to be aoi.properties.label_fetched yet.

Nevertheless, a proper review is required to make it stable and work as expected.

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

No branches or pull requests

1 participant