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

Fix issue where the app wouldn't load for the first request in prod mode #1280

Merged
merged 2 commits into from
Jul 26, 2021

Conversation

artlowel
Copy link
Member

@artlowel artlowel commented Jul 26, 2021

References

Description

This PR adds a check to see if the correlation id exists before adding it to the header.

It also improves the error handling of DSpaceRestService. JS errors (as opposed to error responses) are now thrown on unmodified. That will give us a stacktrace for these kinds of errors in the future.

Instructions for Reviewers

  • Open an incognito window, or clear your cookies
  • Disable javascript
  • Open this PR in prod mode
  • Verify that the page loads properly

Checklist

  • My PR is small in size (e.g. less than 1,000 lines of code, not including comments & specs/tests), or I have provided reasons as to why that's not possible.
  • My PR passes TSLint validation using yarn run lint
  • My PR doesn't introduce circular dependencies
  • My PR includes TypeDoc comments for all new (or modified) public methods and classes. It also includes TypeDoc for large or complex private methods.
  • My PR passes all specs/tests and includes new/updated specs or tests based on the Code Testing Guide.
  • If my PR includes new, third-party dependencies (in package.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.

@artlowel artlowel added bug high priority 1 APPROVAL pull request only requires a single approval to merge labels Jul 26, 2021
@artlowel artlowel added this to the 7.0 milestone Jul 26, 2021
@artlowel artlowel requested a review from tdonohue July 26, 2021 11:44
@artlowel artlowel self-assigned this Jul 26, 2021
Copy link
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.

👍 Thanks @artlowel . This works for me. I tested the before/after scenarios both in Incognito Mode, and using wget on commandline (before it returns an empty HTML page, after it returns the fully rendered page), and this fixes the SSR issues!

@tdonohue tdonohue merged commit 4292af4 into DSpace:main Jul 26, 2021
@artlowel artlowel deleted the fix-first-request-issue branch July 26, 2021 15:08
4science-it pushed a commit to 4Science/dspace-angular that referenced this pull request Jan 26, 2024
CST-13401 add missing metadata

Approved-by: Stefano Maffei
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 APPROVAL pull request only requires a single approval to merge bug high priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If there's no correlation ID cookie, server side rendering crashes
2 participants