Skip to content

fix(zone.js): should not try to patch fetch if it is not writable#36311

Closed
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:fetch-readonly
Closed

fix(zone.js): should not try to patch fetch if it is not writable#36311
JiaLiPassion wants to merge 1 commit intoangular:masterfrom
JiaLiPassion:fetch-readonly

Conversation

@JiaLiPassion
Copy link
Copy Markdown
Contributor

Close #36142

In Firefox extensions, the window.fetch is not configurable, that means

const desc = Object.getOwnPropertyDescriptor(window, 'fetch');
desc.configurable === false;

So in this case, we should not try to patch fetch, otherwise, it will
throw error ('fetch is ReadOnly`)

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.io application / infrastructure changes
  • Other... Please describe:

@JiaLiPassion JiaLiPassion requested a review from mhevery March 30, 2020 00:16
@JiaLiPassion JiaLiPassion added area: zones Issues related to zone.js target: patch This PR is targeted for the next patch release and removed cla: yes labels Mar 30, 2020
@googlebot
Copy link
Copy Markdown

☹️ Sorry, but only Googlers may change the label cla: yes.

@ngbot ngbot Bot modified the milestone: needsTriage Mar 30, 2020
@JiaLiPassion JiaLiPassion force-pushed the fetch-readonly branch 3 times, most recently from 8b1e7ec to f07b6dc Compare March 30, 2020 01:51
@JiaLiPassion JiaLiPassion changed the title fix(zone.js): should not try to patch fetch if it is not configurable fix(zone.js): should not try to patch fetch if it is not writable Mar 30, 2020
Close angular#36142

In Firefox extensions, the `window.fetch` is not configurable, that means

```
const desc = Object.getOwnPropertyDescriptor(window, 'fetch');
desc.writable === false;
```

So in this case, we should not try to patch `fetch`, otherwise, it will
throw error ('fetch is ReadOnly`)
@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Mar 30, 2020

presubmit

@JiaLiPassion
Copy link
Copy Markdown
Contributor Author

@mhevery, it seems the G3 failed, could you post the errors? thanks.

@mhevery
Copy link
Copy Markdown
Contributor

mhevery commented Apr 6, 2020

presubmit

Unrelated failure, forcing green.

@mhevery mhevery added the action: merge The PR is ready for merge by the caretaker label Apr 6, 2020
kara pushed a commit that referenced this pull request Apr 6, 2020
…6311)

Close #36142

In Firefox extensions, the `window.fetch` is not configurable, that means

```
const desc = Object.getOwnPropertyDescriptor(window, 'fetch');
desc.writable === false;
```

So in this case, we should not try to patch `fetch`, otherwise, it will
throw error ('fetch is ReadOnly`)

PR Close #36311
@kara kara closed this in 416c786 Apr 6, 2020
AndrewKushnir added a commit to AndrewKushnir/angular that referenced this pull request Apr 7, 2020
Recent ZoneJS-related commit (angular@416c786) update the `promise.ts` file, but it looks like original PR was not rebased after clang update. As a result, the `lint` CircleCI job started to fail in master after merging that PR (angular#36311). This commit updates the format of the `promise.ts` script according to the new clang rules.
kara pushed a commit that referenced this pull request Apr 7, 2020
Recent ZoneJS-related commit (416c786) update the `promise.ts` file, but it looks like original PR was not rebased after clang update. As a result, the `lint` CircleCI job started to fail in master after merging that PR (#36311). This commit updates the format of the `promise.ts` script according to the new clang rules.

PR Close #36487
kara pushed a commit that referenced this pull request Apr 7, 2020
Recent ZoneJS-related commit (416c786) update the `promise.ts` file, but it looks like original PR was not rebased after clang update. As a result, the `lint` CircleCI job started to fail in master after merging that PR (#36311). This commit updates the format of the `promise.ts` script according to the new clang rules.

PR Close #36487
@SerkanSipahi
Copy link
Copy Markdown

@JiaLiPassion @mhevery when will this merged? Im asking because of this PR has just a merge label.

@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot Bot locked and limited conversation to collaborators May 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: zones Issues related to zone.js cla: yes target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: "fetch" is read-only in firefox add-on only

4 participants