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: Use polling instead of streaming for following logs in Safari #4335

Merged
merged 2 commits into from
May 30, 2018

Conversation

DingoEatingFuzz
Copy link
Contributor

Related WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=185924

Despite having all the requisite primitives and APIs, getting a ReadableStream from a fetch response body in Safari doesn't always work.

For the time being, Safari will instead use the polling-based log watcher, much like IE, Edge, and Firefox use.

I also found a bug in the polling-based log watcher and fixed it.

.filter(frame => frame.Data != null && frame.Offset != null);

if (frames.length) {
frames.forEach(frame => (frame.Data = window.atob(frame.Data)));
Copy link
Contributor

Choose a reason for hiding this comment

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

What is it you're using for atob here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The browser. No dependency needed!

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah it's just btob that has unicode issues is it? 👍 cool

});

// Fetch streaming doesn't work in Safari yet despite all the primitives being in place.
// Bug: https://bugs.webkit.org/show_bug.cgi?id=185924
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any way we could completely replicate/use the environment we are seeing the bug, and then put your working test in it to see if it still works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

By working test do you mean this branch? As in test this branch via https in Safari to see if this fixes the problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

Well it looks like you've reduced the code to something that someone with no knowledge of the nomad-ui can look at, which is super helpful, but that works - so theres no bug there.

If we can see if we can get this on the same environment of where your bug is. That way we can reproduce everything as much as possible but with simpler code, then and try to drill down on exactly what the problem is - I think you mention it could be something to do with differences with the certs? I think the nomad demo site cert uses SNI for example? I doubt its that but would be good if we can check - just ruling things out really.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, to replicate the Safari bug. Yes, that would be great, and as you saw I went down that road.

After failing to replicate it, I had to pull myself out of the rabbit hole and focus back on Nomad 😄

I did publish that code though if you wanted to continue exploring it: https://github.com/DingoEatingFuzz/safari-streaming

I hosted it in my DO droplet with a basic Let's Encrypt cert.

@DingoEatingFuzz DingoEatingFuzz merged commit d5cbcc6 into master May 30, 2018
@DingoEatingFuzz DingoEatingFuzz deleted the b-ui-safari-log-streaming branch May 30, 2018 18:36
@github-actions
Copy link

github-actions bot commented Mar 3, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants