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

🐛 Skip rendering badges on search_only tenants #952

Merged
merged 2 commits into from
Dec 15, 2023

Conversation

jeremyf
Copy link
Contributor

@jeremyf jeremyf commented Dec 15, 2023

Background: A search_only tenant renders SOLR documents that had home
tenants different than the search_only tenant. Part of that rendering
includes the underlying Work's collection type. The SOLR document
stores the Hyrax::CollectionType's ID.

The search_only tenant might have the same ID for
Hyrax::CollectionType but it is not the same thing. Further, the home
tenant might have an ID that is not in the search_only tenant, which
results in an ActiveRecord::RecordNotFound error.

Prior to this commit, we always attempted to render the badge.

With this commit, we add some guarding logic to avoid rendering the
badge when we're likely not rendering within the SOLR documents home
tenant.

Related to:

@jeremyf jeremyf force-pushed the i951-search-only-skip-collection-type branch from 13d044c to 88f8a4c Compare December 15, 2023 20:52
*Background:* A search_only tenant renders SOLR documents that had home
tenants different than the search_only tenant.  Part of that rendering
includes the underlying Work's collection type.  The SOLR document
stores the `Hyrax::CollectionType`'s ID.

The search_only tenant might have the same ID for
`Hyrax::CollectionType` but it is not the same thing.  Further, the home
tenant might have an ID that is not in the search_only tenant, which
results in an `ActiveRecord::RecordNotFound` error.

Prior to this commit, we always attempted to render the badge.

With this commit, we add some guarding logic to avoid rendering the
badge when we're likely not rendering within the SOLR documents home
tenant.

Related to:

- #951
- samvera/hyku#1815
@jeremyf jeremyf force-pushed the i951-search-only-skip-collection-type branch 3 times, most recently from fad8bc0 to 94ed0c7 Compare December 15, 2023 22:21
Prior to this commit we were relying on a SHA; one that looks like it
might not be all that durable.

With this commit, we instead favor using a test strategy to turn it on.
@jeremyf jeremyf force-pushed the i951-search-only-skip-collection-type branch from 94ed0c7 to f326a2b Compare December 15, 2023 22:51
@jeremyf jeremyf merged commit dfa08f2 into main Dec 15, 2023
6 of 7 checks passed
@jeremyf jeremyf deleted the i951-search-only-skip-collection-type branch December 15, 2023 23:21
jeremyf added a commit to samvera/hyku that referenced this pull request Dec 19, 2023
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.

2 participants