-
Notifications
You must be signed in to change notification settings - Fork 256
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
fix:mirador_crash #3927
base: main
Are you sure you want to change the base?
fix:mirador_crash #3927
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3927 +/- ##
=======================================
Coverage 94.59% 94.59%
=======================================
Files 315 315
Lines 14773 14776 +3
Branches 2491 2490 -1
=======================================
+ Hits 13974 13977 +3
Misses 795 795
Partials 4 4 ☔ View full report in Codecov by Sentry. |
Hi @fstoe, could you add a test case for that patch? Something like it('does not crash if json is not a manifest', () => {
const state = { manifests: { x: { json: {} } } };
const received = getManifestoInstance(state, { manifestId: 'x' });
expect(received).toBe(undefined);
}); |
Hey @lutzhelm, |
Noticed another potential issue in the catalog
@@ -23,7 +23,7 @@ const mapStateToProps = (state, { manifestId, provider }) => { | |||
: getCanvases(state, { manifestId }).length; | |||
return { | |||
active: getWindowManifests(state).includes(manifestId), | |||
error: manifest.error, | |||
error: manifest.error || !manifesto, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have noticed this earlier: This change results in a list of errors in the catalog list for every manifest that is configured in the catalog
settings but not in windows
. While you can "Try again" successfully, this should be fixed. It's probably sufficient to change this line to
error: manifest.error || (!manifesto && !!manifest.json),
Manifests that have not been used in windows before don't have a manifesto instance up until this point, and at the moment the component is initially rendered, isFetching
is not yet true, so the same check that is used for ready
should be used here additionally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm also thinking about how to test this automatically, no efficient idea yet, but I think it's not necessary for the scope of that PR.
I found out that adding something through the add button in the catalog view which is json but not a manifest makes the viewer crash.
steps to reproduce: