Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Tags do not show. #3

Open
henryluan95 opened this issue May 17, 2023 · 1 comment
Open

Tags do not show. #3

henryluan95 opened this issue May 17, 2023 · 1 comment

Comments

@henryluan95
Copy link

When the input returns multiple results, the tags don't show up for all of them.
image
After clicking on the item and then returning to the previous search, the tag will show up for the viewed item (and some other items but not all)
image
image

@jasonflorentino
Copy link
Owner

Thanks for pointing this out Henry! It's actually a quirk of the current implementation: I have to make a second request for that info and wanted to be reeeally nice to that API and only fetch them one at a time. To minimize refetching (and build up the list as the user browses more results) I cache already-fetched "disposal headers" in memory. But since this is currently deployed on a serverless environment, and without any persistent storage, we lose that cache when the host expires the app instances.

if (results.length) {
// Decorate results with their `disposal_header`:
// First check if we have the disposal_header already cached in memory.
// If not, request ONE of them to add on, and store it in cache.
// This lets us be nice and avoid making a spike of requests their api
// in the case we have a long list of search results.
// Make sure to get/set the IDs as strings in the cache Map!
// (We'll also be populating this as clients hit individual pages)
results = [

It felt like a reasonable trade off at the time: The top hit will have its Disposal Header already visible, but results with lower scores will still just be one click away. And if the user comes back to the search page (presumably because they are still searching for the right info), further "previews" of the Disposal Headers will now also be available.

I'll leave this open for now as it does feel off from what someone might expect, but a fix may not come around until one of the things above changes. For instance my willingness to hit an API that I may or may not be supposed to be hitting. 😆

Hope you're well!
—Jason

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants