endo icon indicating copy to clipboard operation
endo copied to clipboard

React Native Incompatibility: "failed to delete intrinsics.[object Object]syncGenerator%6length"

Open EtDu opened this issue 4 years ago • 9 comments

When running lockdown.umd.js inside Safari and calling lockdown(), the following error appears:

[Log] Removing intrinsics.%AsyncGenerator%.length
[Error] failed to delete intrinsics.[object Object]syncGenerator%6length
	Console Evaluation (Console Evaluation 1:2063)
	Console Evaluation (Console Evaluation 1:1937)
	Console Evaluation (Console Evaluation 1:2046)
	Console Evaluation (Console Evaluation 1:2074)
	Console Evaluation (Console Evaluation 1:5249)
	Console Evaluation (Console Evaluation 1:5306)
	Console Evaluation (Console Evaluation 2:3)
	evaluateWithScopeExtension
	(anonymous function)
	_wrapCall
< TypeError: Unable to delete property.

EtDu avatar Apr 09 '21 02:04 EtDu

@erights It looks like there’s a non-standard non-configurable length property on AsyncGenerator. On the one hand, this seems to be a Safari bug, and on the other this is probably safe to allow. Should we retitle this to “Add AsyncGenerator.length to allow-list to accommodate Safari” and do the work?

kriskowal avatar May 07 '21 15:05 kriskowal

I know I've run SES on Safari before. Is this new? Also, AsyncGenerator is a function. Functions have a length property. I'll investigate. Don't do anything until we understand this.

What version of Safari?

erights avatar May 07 '21 18:05 erights

To try diagnosing this, I visited https://ses-demo.netlify.app/demos/console/ using Safari Version 14.1 (16611.1.21.161.3) . I found that my old Safari bug came back! I reopened it at

https://bugs.webkit.org/show_bug.cgi?id=222538#c17

After I revise endo to workaround that bug, I'll get back to this one.

erights avatar May 07 '21 22:05 erights

That one is in progress at https://github.com/endojs/endo/pull/711

erights avatar May 07 '21 23:05 erights

I cannot reproduce this. While running on my development version of #711 , running a local http server, and visiting http://localhost:8080/demos/console/ I get no errors in the console when I refresh. That demo calls lockdown with no arguments, letting everything default. What lockdown arguments are you using?

erights avatar May 07 '21 23:05 erights

Revising to

lockdown({
  errorTaming: 'unsafe',
  stackFiltering: 'verbose',
  overrideTaming: 'severe',
});

I was still not able to reproduce. This sets all possibly relevant lockdown options to their non-default setting.

erights avatar May 07 '21 23:05 erights

@EtDu @kumavis What version of Safari are you using?

erights avatar May 07 '21 23:05 erights

sorry for the safari/react-native confusion

kumavis avatar May 10 '21 03:05 kumavis

@kumavis @EtDu what is the state of this? If it can now be closed, please close it.

erights avatar Aug 02 '22 06:08 erights

apologies for the necropost, appreciate the raising of this issue ^ and prev comments

i'm also looking into this here

  • https://github.com/LavaMoat/docs/issues/16

Revising to

lockdown({
  errorTaming: 'unsafe',
  stackFiltering: 'verbose',
  overrideTaming: 'severe',
});

I was still not able to reproduce. This sets all possibly relevant lockdown options to their non-default setting.

after the revision

undefined is not an object (evaluating '(_console = console)._errorOriginal.apply')
undefined is not an object (evaluating (_console = console)._errorOriginal.apply')

any thoughts appreciated while i continue debugging

edit: if sticking to the original React Native title then imo should remain open till fully resolve and present a solution nb: it's an error on Android JSC only blocking runtime - not on Android V8 (various warnings), or iOS JSC (Promise warnings)

otherwise if renaming to Add AsyncGenerator.length to allow-list to accommodate Safari i think we can close this from your findings ^

leotm avatar Mar 09 '23 18:03 leotm

@naugtur and i found the semi-root cause and raised the issue here

  • https://github.com/react-native-community/jsc-android-buildscripts/issues/181

leotm avatar Mar 14 '23 13:03 leotm

Ok, with that diagnosis, I agree we should

retitle this to “Add AsyncGenerator.length to allow-list to accommodate Safari” and do the work?

as @kriskowal suggests at https://github.com/endojs/endo/issues/660#issuecomment-834560524

Thanks @leotm !

Any idea why they do this?

erights avatar Mar 14 '23 13:03 erights

no problemo! makes sense ^ not figured the why yet, but cloned the repo and run the big download (1.12GB) script to see (there's also various patches going on and issues, but none related to the length)

leotm avatar Mar 14 '23 18:03 leotm