Page MenuHomePhabricator

[Bug] mobile-html: DOMRect object from InteractionHandler response cannot be decoded on iOS
Closed, ResolvedPublic

Description

Steps to Reproduce

  1. Build & run iOS mobile-html prototype https://github.com/wikimedia/wikipedia-ios-lite (master)
  2. Open any article
  3. Tap any reference

Expected Results

  • App doesn't crash

Actual Results

  • App crashes

Environments Observed

  • Prod

Additional notes

  • It looks like iOS is unable to decode DOMRect object that's included in ReferenceItem. DOMRect behaves differently than plain JS objects - for example, calling Object.keys(someDOMRectObject) will return an empty array. Node 12.3.1 has a toJSON() method that converts DOMRect objects into plain JS objects but since the page library is still on 10.16.0, we can't use it. We could create a plain object using DOMRect's keys and values.

Event Timeline

We left that out since we wanted to have something platform agnostic. Is there a way you could do the conversion to whatever is needed on the iOS native side?

@bearND Unfortunately, no. iOS is doing all the decoding of JS messages and I'm just getting a dictionary with the result. There's no way for me to get raw JS and implement decoding on my own on the native side.

@NHarateh_WMF where in the iOS app or lite app code is this used so I can better understand this?

Mentioned in SAL (#wikimedia-operations) [2019-07-15T20:44:28Z] <bsitzmann@deploy1001> Started deploy [mobileapps/deploy@bc3a2fd]: Update mobileapps to 7fd39da (T227907)

Mentioned in SAL (#wikimedia-operations) [2019-07-15T20:52:21Z] <bsitzmann@deploy1001> Finished deploy [mobileapps/deploy@bc3a2fd]: Update mobileapps to 7fd39da (T227907) (duration: 07m 53s)

Mentioned in SAL (#wikimedia-operations) [2019-07-15T20:52:28Z] <bsitzmann@deploy1001> Started deploy [mobileapps/deploy@bc3a2fd]: Update mobileapps to 7fd39da (T227907)

The deploy keeps failing due to the talk page endpoint timing out.

Check 'endpoints' failed: /{domain}/v1/page/talk/{title} (Get structured talk page for enwiki Salt article) timed out before a response was received

Mentioned in SAL (#wikimedia-operations) [2019-07-15T20:54:49Z] <bsitzmann@deploy1001> Finished deploy [mobileapps/deploy@bc3a2fd]: Update mobileapps to 7fd39da (T227907) (duration: 02m 24s)

Mentioned in SAL (#wikimedia-operations) [2019-07-16T17:19:03Z] <bsitzmann@deploy1001> Started deploy [mobileapps/deploy@cb6e7bc]: Update mobileapps to 334a4c4 (T227907)

Mentioned in SAL (#wikimedia-operations) [2019-07-16T17:23:54Z] <bsitzmann@deploy1001> Finished deploy [mobileapps/deploy@cb6e7bc]: Update mobileapps to 334a4c4 (T227907) (duration: 04m 51s)