Code review comment for lp://staging/~marcustomlinson/unity-scope-click/lp-1591422

Revision history for this message
Marcus Tomlinson (marcustomlinson) wrote :

Looking at:

    https://errors.ubuntu.com/problem/f271ff40a203e6d22ab0bf36beb8f6f6adddb90a,

we can see that the crash originates from:

    ubuntuone_credentials.cpp:63 -> "promise.set_value(token);"

Digging a little deeper into the future source, _M_set_result() seems to only throw std::future_error for the promise_already_satisfied condition. This unhandled exception is tearing down the scope.

We have 2 places in code where getCredentials() is called:
    click::CredentialsService::getToken()
    & InstalledPreview::get_consumer_key()

I suspect that during "QCoreApplication::processEvents();" in click::CredentialsService::getToken(), we may risk processing 2 getCredentials() calls in parallel, causing multiple callbacks into the signal handler.

This change adds a safety net which may or may not make the issue go away completely, but it certainly shouldn't make things any worse.

« Back to merge proposal