Safari fix: refactor Stream Parses to use while(true) instead of for await#1444
Safari fix: refactor Stream Parses to use while(true) instead of for await#1444
for await#1444Conversation
🦋 Changeset detectedLatest commit: 5e6735c The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
carterworks
left a comment
There was a problem hiding this comment.
Please run pnpm changeset, select @adobe/alloy, and write what you want to go on the public changelog file
dompuiu
left a comment
There was a problem hiding this comment.
This PR seems ok. Please do what Carter asked.
As I already told you, there are some potential issues that could be fixed. I sent you the list on Slack.
jonsnyder
left a comment
There was a problem hiding this comment.
Looks good. Can you remove the hard-coded 10 seconds in this error message:
sure |
Nina finished what he was asking for.
Description
In previous version we were using
for await(chunks in stream)which was causing issues in Safari. Safari does have support forfor awaitsyntax. The problem is that Safari'sReadableStreamclass does not implementSymbol.asyncIteratoron its prototype.The solution is to refactor the code to use
stream.getReader()andwhile(true),catch,finallyblock.Related Issue
Motivation and Context
Screenshots (if appropriate):
Checklist:
pnpm changeset) or it is not necessary because this PR is not consumer-facing.