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

Seeding Input: Duplicates appearing in Area Dropdown #65

Open
braughtg opened this issue Aug 26, 2024 · 2 comments
Open

Seeding Input: Duplicates appearing in Area Dropdown #65

braughtg opened this issue Aug 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@braughtg
Copy link
Contributor

The Area drop down in the Seeding Input form contains duplicates. The same list of areas appears to be being appended to the dropdown multiple times. Each Area should appear in this list only one time.

Steps to Reproduce

  1. Clear browsing data
  2. Visit Seeding Input form
  • Area's will be listed once.
  1. Visit a different tab (e.g. info)
  2. Area list will update with a second copy of all areas.
  3. Each visits to another tab and return to the Seeding Input form will add another copy of the areas to the drop down.

Based on the above behavior this appears to have something to do with the way the caching is done for areas. It should be compared to what is being done for the crops which are not exhibiting the same behavior.


Issue by braughtg
Tuesday Jun 07, 2022 at 13:06 GMT
Originally opened as DickinsonCollege/FarmData2#460

@braughtg braughtg added the bug Something isn't working label Aug 26, 2024
@braughtg
Copy link
Contributor Author

Confirmed that this is related to the caching of the areas in the local storage. When the areas are requested each time and not retrieved from cache there is no duplication.


Comment by braughtg
Tuesday Jun 07, 2022 at 13:16 GMT

@braughtg
Copy link
Contributor Author

Issue is that the call to getAllPages appends new responses to the provided array, it does not clear the array. Thus, when the cached version of the area response is used, the subsequent call to the API to check for updates adds to the response, it does not replace the response.


Comment by braughtg
Tuesday Jun 07, 2022 at 13:25 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants
@braughtg and others