Repository navigation
Lock Symbol.dispose on web to fix Skia dispose errors in Safari - #102521
Conversation
|
@codex review |
|
@MelvinBot review this |
ReviewThe PR looks good to merge. The fix matches the root cause, runs early enough, and I found nothing the lock would break. The only change I'd ask for is a wrong comment about tslib. Please fix:
Optional:
What I checked
I didn't run the app. The bug needs Safari, and the test browser is Chromium, which has a native Linked issue: [Sentry: APP-M75 / APP-M74 / APP-M8W] Web Safari crash, Skia Host.dispose calls an undefined this[Symbol.dispose] |
|
@cretadn22 Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-09-30.at.23.44.05.movAndroid: mWeb ChromeScreen.Recording.2026-09-30.at.23.41.09.moviOS: HybridAppScreen.Recording.2026-09-30.at.23.42.00.moviOS: mWeb SafariScreen.Recording.2026-09-30.at.23.41.35.movMacOS: Chrome / SafariScreen.Recording.2026-09-30.at.23.36.26.mov |
| @@ -0,0 +1,37 @@ | |||
| import type {TupleToUnion} from 'type-fest'; | |||
There was a problem hiding this comment.
I initially considered putting this into a folder with index.ts and .native.ts, but that would break the uniform naming convention of the polyfills directory. More importantly, as the dealbreaker it would make the implementation impossible to import cleanly in unit tests. So I am fine with this implementation
mountiny
left a comment
There was a problem hiding this comment.
Nice thanks for the testing @cretadn22
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.5.0-0 🚀
|
|
No help site update is needed. This PR adds an internal web polyfill so Skia charts stop throwing errors in Safari, which makes no user-facing workflow change and makes no help article sentence incorrect. |
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.5.0-5 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Skia's web host objects key their
[Symbol.dispose]method once at load, butdispose()rereadsSymbol.disposeon every call. Safari has no native symbol, so if a script defines it later, every chart frame throws. New web polyfillSymbolDispose.web.ts, imported first inindex.js, locks both dispose symbols like the native property. Unit tests added.Fixed Issues
$ #102043
PROPOSAL:
Tests
Test 1 - Safari: Skia charts keep working after a late
Symbol.dispose/home) so the insights chart renderstypeof Symbol.disposeandObject.getOwnPropertyDescriptor(Symbol, 'dispose')symboland the descriptor showswritable: falseandconfigurable: falseSymbol.dispose = Symbol('late'), then runSymbol.dispose === Symbol.for('Symbol.dispose')true(the assignment was ignored)disposethis[Symbol.dispose] is not a functionerrors appear and the chart tooltip follows the cursorTest 2 - Chrome: native symbol is left untouched
/home) so the insights chart rendersSymbol.dispose === Symbol.for('Symbol.dispose')false(the native symbol is kept, the polyfill did nothing)Test 3 - Native: charts are unaffected
Offline tests
N/A - web polyfill only, no API calls or Onyx writes.
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari