Skip to content

Uncaught exception in verifyNotFailed (Javascript, mostly iOS 12.2) #1733

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
momander opened this issue Apr 30, 2019 · 5 comments
Closed

Uncaught exception in verifyNotFailed (Javascript, mostly iOS 12.2) #1733

momander opened this issue Apr 30, 2019 · 5 comments

Comments

@momander
Copy link

Environment

  • Operating System version: iOS 12.2
  • Browser version: Safari 12.1
  • Firebase SDK version: 5.9.4
  • Firebase Product: firebase/firestore

Describe the problem

About a quarter of my website visitors using iOS 12.2 and Safari 12.1 get this error, or about 400-500 out of 1,700 visitors. I have not heard any reports of failing functionality yet, but they are getting uncaught Javascript exceptions which are tracked by Google Analytics.

Steps to reproduce:

Sorry, I don't have access to an iOS 12.2 device. I only see the hundreds upon hundreds of these errors in the log.

Relevant Code:

When the exception occurs, the Javascript call stack is:
documentVisibilityHandler()
which called enqueueAndForget()
which called enqueue()
which called verifyNotFailed() where the exception occurred

Sometimes (less often) the call stack is:
handleDelayElapsed()
which called enqueueAndForget()
which called enqueue()
which called verifyNotFailed() where the exception occurred

Sometimes (less often) the call stack is:
windowUnloadHandler
which called enqueueAndForget()
which called enqueue()
which called verifyNotFailed() where the exception occurred

Other clients:

This error also occurs very occasionally in Windows and Android clients. When this happens, there is a better error message:

Error: FIRESTORE (5.9.4) INTERNAL ASSERTION FAILED: AsyncQueue is already failed

or

Error: FIRESTORE (5.9.4) INTERNAL ASSERTION FAILED: AsyncQueue is already failed: The transaction was aborted, so the request cannot be fulfilled.

My code to log Javascript errors in Google Analytics:

window.onerror = function(message, source, lineno, colno, error) {
  if (error) message = error.stack;
  if (!location.host.startsWith('localhost')) {
    ga('send', 'event', 'window.onerror', message, navigator.userAgent);
  }
}

My Firebase configuration:

let db = firebase.firestore();
db.enablePersistence({experimentalTabSynchronization:true})

@google-oss-bot
Copy link
Contributor

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@momander
Copy link
Author

Oh, one more data point: most of my website visitors do not trigger code that reads or writes to Firestore. So most of the visitors who trigger the verifyNotFailed exception only run this code in their browsers:

var firebaseConfig = {
  ...
};
firebase.initializeApp(firebaseConfig);
let db = firebase.firestore();
db.enablePersistence({experimentalTabSynchronization:true});

@mikelehen
Copy link
Contributor

mikelehen commented May 1, 2019

EDIT: Fixed link to github issue.

Thanks for the report. This seems to be a regression in iOS 12.2 which is being tracked by #1670 and https://bugs.webkit.org/show_bug.cgi?id=197050. The only workaround for now is to not enable persistence.

@var-const
Copy link
Contributor

Sorry to hear about the problems you're running into. The issues described appear very similar to 2 problems that were reported recently:

  1. Android failure with AsyncQueue is already failed: The transaction was aborted, so the request cannot be fulfilled. sounds very similar AsyncQueue is already failed: The transaction was aborted, so the request cannot be fulfilled. #1642. Interesting that it also happens on Windows in your case -- how often are Windows devices affected, compared to Android?
  2. The failure that happens specifically on iOS 12.2 is likely IOS 12.2 - Safari 12.1 - INTERNAL UNHANDLED ERROR: ... error ... Indexed Database server #1670.

Note that these two are separate issues with different causes, but they are triggered in a very similar manner -- sending the app to the background may result in a failure. This seems consistent with the way only some of the users experience the issue.

Can you please provide some additional info?

  1. Logs would be very helpful (just in case, firebase.firestore.setLogLevel('debug')). If they contain any sensitive data, feel free to send them over email to varconst at google.com. Especially on iOS, I hope logs would help to determine whether the issue here is indeed IOS 12.2 - Safari 12.1 - INTERNAL UNHANDLED ERROR: ... error ... Indexed Database server #1670.
  2. Any additional information on what triggers the exceptions would be useful. In particular, my suspicion would be that sending the app to background is triggering the issue, would be very helpful if you could confirm.

@momander
Copy link
Author

My apologies; I don't have access to either an iOS 12.2 device or a Windows machine. I tried to reproduce the error on a virtual Windows machine on lambdatest.com, but was not able to.

@firebase firebase locked and limited conversation to collaborators Oct 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants