Skip to content

Cache behavior for unknown type#624

Merged
artlowel merged 2 commits intoDSpace:masterfrom
atmire:cache-behavior-unknown-type
Mar 18, 2020
Merged

Cache behavior for unknown type#624
artlowel merged 2 commits intoDSpace:masterfrom
atmire:cache-behavior-unknown-type

Conversation

@benbosman
Copy link
Copy Markdown
Member

This is a continuation of #611

We noticed the Angular UI currently also breaks in the BaseResponseParsingService.process() function if REST contains a type not (yet) known to Angular.

If the data is part of a type not yet known to Angular, the object is null
The null object causes an exception further down the road

The null objects will be ignored here since there's on use in caching them

… null

The null object causes an exception further down the road
Copy link
Copy Markdown
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @benbosman

I had just one inline comment

} else if (isRestDataObject(data)) {
const object = this.deserialize(data);
if (isNotEmpty(data._embedded)) {
if (isNotEmpty(data._embedded) && hasValue(object)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it makes more sense to move this hasValue(object) down to the if on line 60. That way even if the main object in a response can't be parsed, its embeds will still be processed.

Copy link
Copy Markdown
Member

@tdonohue tdonohue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 This seems tiny, so I'm fine with merging this as soon as @artlowel is satisfied.

… null

The null object causes an exception further down the road
Copy link
Copy Markdown
Member

@artlowel artlowel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @benbosman

Tested again, and it works.

@artlowel artlowel merged commit 8f1df19 into DSpace:master Mar 18, 2020
@tdonohue tdonohue added this to the 7.0beta2 milestone Jan 26, 2021
4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Nov 30, 2023
[DSC-1093] Added detect duplication label

Approved-by: Giuseppe Digilio
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.

3 participants