Closed andrewdmontgomery closed 1 month ago
App Name | Gravatar SwiftUI Prototype Build | |
Build Number | 1428 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-swiftui.prototype-build | |
Commit | 2d97c892208d160ace65100f340d022a82101ef6 | |
App Center Build | Gravatar SDK Demo - SwiftUI #234 |
App Name | Gravatar UIKit Prototype Build | |
Build Number | 1428 | |
Version | 1.0 | |
Bundle ID | com.automattic.gravatar-sdk-demo-uikit.prototype-build | |
Commit | 2d97c892208d160ace65100f340d022a82101ef6 | |
App Center Build | Gravatar SDK Demo - UIKit #234 |
This is technically accurate (all 400+ codes are "invalid". But there may be a good reason why we defined this as ==. So I wanted to call this out.
That check is for deciding to decode the error into ModelError
and we can only assume this is possible if the specs say so. Since we treat the decoding operation as "optional" we can probably move fwd with >=400 as well. But we can probably make it ">=400 and <500", i don't think 5XX errors are any fit for the ModelError
anyway.
This PR temporarily updates the OpenAPI.spec – but only as a demonstration. This change to the OpenAPI spec should not be merged unless and until we have discussed it with the Backend team and Android.
👍
The proposed change to the Error
schema was accepted. A more comprehensive change is pending: https://github.a8c.com/Automattic/gravatar/pull/109013
I will wait for that PR to merge, and apply those changes to this PR.
The proposed change to the
Error
schema was accepted. A more comprehensive change is pending: https://github.a8c.com/Automattic/gravatar/pull/109013I will wait for that PR to merge, and apply those changes to this PR.
It has been merged 🎉
Closes #447 #453
Description
If the QE is open while a token expires, the failure message is generic and doesn't provide a way for the user to re-authenticate.
This PR updates the UX, and error message handling, so that the user is informed that their session has expired, and they are presented with the ability to re-authenticate.
This PR also makes the following change:
This is technically accurate (all 400+ codes are "invalid". But there may be a good reason why we defined this as
==
. So I wanted to call this out.This PR also localizes one of the toast messages. It looks like other toast messages still need to be localized. I'll handle those in a separate PR.
Updating the OpenAPI spec
This PR now includes an updated OpenAPI spec that addresses the issue mentioned here.
~This PR temporarily updates the OpenAPI.spec – but only as a demonstration. This change to the OpenAPI spec should not be merged unless and until we have discussed it with the Backend team and Android.~
~When an expired token is used on the endpoint
/me/avatars/{imageId}/email
, the json response only includes theerror
key/value (with no businesscode
provided):~~We are currently using
ModelError
to represent this response, which is a model generated from theError
schema in the OpenAPI spec. That spec lists both thecode
anderror
as "required".~~As a result, this JSON data in the response fails to decode as a
ModelError
, and we cannot pass the message to the client.~~If using
ModelError
(Error
schema) is appropriate for this endpoint, then either:~code
~code
as optional~~If using the
ModelError
is not appropriate, then we have some refactoring to do.~Testing Steps
Testing Avatar Selection
Profile editor with oauth
You are not authorized to perform this action.
(This string is provided by the backend in the response, and I believe it should be localized)Testing Avatar Upload
You are not authorized to perform this action.
(This string is provided by the backend in the response, and I believe it should be localized)