Open Bl4ckburn opened 2 months ago
Hey @Bl4ckburn it appears that in the Ionic runtime, the credentials
property is not writable
, whereas in cocos
, it actually just lacks a setter. So if you want to submit a PR with your change where we keep the existing logic but change cocos-ignore
to just ignore
(to make it more generic) and to also skip assignment if the credentials
property is not writable
, and test that on Ionic that'd definitely be appreciated.
Can you tell me how options
params object looks like in cocos engine after executing buildFetchOptions
function?
After deeper analysis it comes out that in WEB and Mobile APP options
is always an empty object (in my case), so my isWritable
function always return false
. Thats why it's working.
I am afraid that this condition may completely block the cocos engine from replacing credentials.
Just in case you're wondering what values "credentials" can take.
type RequestCredentials = "include" | "omit" | "same-origin";
That is code from lib.dom.d.ts in typescript lib.
Hey @Bl4ckburn unfortunately this is not something I can prioritize at the moment, but you are welcome to investigate.
Hey everyone, I am currently using nakama-js in combination with ionic (capacitor) and after upgrading the version of capacitor-android to 5.4.0 (minimum) and compile project to APK it shows an error in app from nakama (even though I don't use the cocos engine):
It looks as if newer versions of lib.dom block the ability to change 'credentials'. My proposal is to simply checking whether the 'credentials' property is readonly, just to start with. I don't know how the cocos engine itself reacts to the change.
checking function:
and change condition line before credentials assign in buildFetchOptions function from:
if (!descriptor?.set) {
toif (!descriptor?.set && isWritable(fetchOptions, 'credentials')) {
I would be grateful if someone had a better idea on how to solve this problem, without cutting off the cocos engine in the future by above condition.