Page MenuHomePhabricator

Edit Recovery not working on Safari
Closed, ResolvedPublicBUG REPORT

Description

What is the problem?

Editing on Safari, the IndexedDB database gets created but never populated.

It was working on 26th Feb T351821#9578495.

Environment

Browser: Safari 16.5, 17.3.
Wiki(s): https://en.wikipedia.beta.wmflabs.org MediaWiki 1.42.0-alpha (c3cc71b) 08:49, 13 March 2024.

QA Results - Beta

Details

Event Timeline

Debugging so far, it looks like deleteExpiredData never resolves/rejects on Safari — still looking (:


After chasing that down, probably not the cause, and instead sometimes

window.addEventListener( 'beforeunload', saveFormData );

and/or

window.addEventListener( 'visibilitychange', saveFormData );

overwrites/clears the edit recovery data, and then leaves the IndexedDB in an unusable state, but only on Safari??

Change 1010894 had a related patch set uploaded (by Samtar; author: Samtar):

[mediawiki/core@master] [WIP] editRecovery: Safari

https://gerrit.wikimedia.org/r/1010894

I think I've narrowed it down to

window.addEventListener( 'visibilitychange', saveFormData );

so have commented that out for my WIP patch, but I'll keep digging...

Not sure if we should 'rush' out a fix (i.e. commenting out that), seeing as currently edit recovery doesn't work at all for Safari users?

I'm not sure why, but

window.addEventListener( 'blur', saveFormData );

seems to work fine.

Moving to review/feedback as I guess we should get this out the door fairly soon. It might be worth revisiting this to try to track down a root cause though.

Change 1010894 merged by jenkins-bot:

[mediawiki/core@master] editRecovery: use 'blur', not 'visibilitychange'

https://gerrit.wikimedia.org/r/1010894

@TheresNoTime Edit Recovery is now working as seen in the videos below. This will be moved to Done. Thanks for all your work!

Status: ✅PASS
Environment: Beta: 1.42.0-alpha (15e1fb6)
OS: macOS Sonoma & Ventura
Browser: Safari 16.5 & 17.3
Device: MBA M2
Emulated Device:: BrowerStack
Test Links:
https://en.m.wikipedia.beta.wmflabs.org/wiki/Dog#

✅AC1: https://phabricator.wikimedia.org/T360015

Safari 16.5Safari 17.3