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

ui: Lazily detect HTTP protocol #7644

Merged
merged 1 commit into from
Apr 15, 2020
Merged

Conversation

johncowen
Copy link
Contributor

This commit includes 2 things:

  1. Sometimes (seemingly due to client caching), performance entries
    aren't available, even for the currently executing script. This waits
    until the first retrieval of 'CONSUL_HTTP_PROTOCOL' before using the
    performance entries to decide this. This means that the entries aren't
    inspected until ember has initialized, which means that the entries are
    always available.

  2. getCurrentResource/getResourceFor could potentially return undefined
    if the correct entry could not be found. This adds a default {} return
    value if the resource cannot be found. This means that if for whatever
    reason the correct resource cannot be found at least we don't fail with
    an error and just drop back to HTTP/1 functionality.

Fixes #7643

This commit includes 2 things:

1. Sometimes (seemingly due to client caching), performance entries
aren't available, even for the currently executing script. This waits
until the first retrieval of 'CONSUL_HTTP_PROTOCOL' before using the
performance entries to decide this. This means that the entries aren't
inspected until ember has initialized, which means that the entries are
always available.

2. getCurrentResource/getResourceFor could potentially return undefined
if the correct entry could not be found. This adds a default {} return
value if the resource cannot be found. This means that if for whatever
reason the correct resource cannot be found at least we don't fail with
an error and just drop back to HTTP/1 functionality.
@johncowen johncowen added the theme/ui Anything related to the UI label Apr 14, 2020
@johncowen johncowen requested a review from a team April 14, 2020 11:42
@johncowen johncowen added this to the 1.7.x milestone Apr 14, 2020
Copy link
Contributor

@kaxcode kaxcode left a comment

Choose a reason for hiding this comment

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

LGTM 🐛

@johncowen johncowen merged commit 04a8a77 into master Apr 15, 2020
@johncowen johncowen deleted the ui/bugfix/lazy-detect-protocol branch April 15, 2020 13:42
hashicorp-ci pushed a commit that referenced this pull request Apr 15, 2020
This commit includes 2 things:

1. Sometimes (seemingly due to client caching), performance entries
aren't available, even for the currently executing script. This waits
until the first retrieval of 'CONSUL_HTTP_PROTOCOL' before using the
performance entries to decide this. This means that the entries aren't
inspected until ember has initialized, which means that the entries are
always available.

2. getCurrentResource/getResourceFor could potentially return undefined
if the correct entry could not be found. This adds a default {} return
value if the resource cannot be found. This means that if for whatever
reason the correct resource cannot be found at least we don't fail with
an error and just drop back to HTTP/1 functionality.
@johncowen johncowen modified the milestones: 1.7.x, 1.7.3 Apr 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Web UI broken: Cannot read property 'nextHopProtocol' of undefined
2 participants