[OTP] Define and map OTP filling ActionResultCodes
This CL defines Mojo ActionResultCodes for OTP retrieval and filling
errors, registers them in UMA enums.xml, and maps OneTimeTokenRetrievalError
to the corresponding Mojo codes in AttemptOtpFillingTool.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
// Please see the comment above about adding new values.should we replicate this comment to the end of this section, too?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +2 |
// Please see the comment above about adding new values.should we replicate this comment to the end of this section, too?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
lgtm % comments
// TODO(crbug.com/502908360): Add meaningful error message.remove this TODO?
kOtpRetrievalTimeout = 1400,`kOtpRetrievalTimeout` is defined here and in `enums.xml`, but it isn't mapped anywhere in `AttemptOtpFillingTool::OnOtpRetrieved`.
Previously, `!result.has_value()` defaulted to `kToolTimeout`, but now it defaults to `kOtpRetrievalError` (1401). If a timeout occurs (for example, if the service returns `OneTimeTokenRetrievalError::kSmsOtpBackendTimeout`), it will fall through to the default generic `kOtpRetrievalError`.
If the intent was to map timeout errors to `kOtpRetrievalTimeout`, you should add it to the `switch` statement in `attempt_otp_filling_tool.cc`. If the timeout mapping is planned for a future CL, feel free to ignore this.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
| Commit-Queue | +2 |
// TODO(crbug.com/502908360): Add meaningful error message.Trang Mairemove this TODO?
Done. Thank you.
`kOtpRetrievalTimeout` is defined here and in `enums.xml`, but it isn't mapped anywhere in `AttemptOtpFillingTool::OnOtpRetrieved`.
Previously, `!result.has_value()` defaulted to `kToolTimeout`, but now it defaults to `kOtpRetrievalError` (1401). If a timeout occurs (for example, if the service returns `OneTimeTokenRetrievalError::kSmsOtpBackendTimeout`), it will fall through to the default generic `kOtpRetrievalError`.
If the intent was to map timeout errors to `kOtpRetrievalTimeout`, you should add it to the `switch` statement in `attempt_otp_filling_tool.cc`. If the timeout mapping is planned for a future CL, feel free to ignore this.
You're right, timeout will be planned for a future cl (crbug/530535640).
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
From googleclient/chrome/chromium_gwsq/ipc/config.gwsq:
IPC: cl...@chromium.org
📎 It looks like you’re making a possibly security-sensitive change! 📎 IPC security review isn’t a rubberstamp, so your friendly security reviewer will need a fair amount of context to review your CL effectively. Please review your CL description and code comments to make sure they provide context for someone unfamiliar with your project/area. Pay special attention to where data comes from and which processes it flows between (and their privilege levels). Feel free to point your security reviewer at design docs, bugs, or other links if you can’t reasonably make a self-contained CL description. (Also see https://cbea.ms/git-commit/).
IPC reviewer(s): cl...@chromium.org
Reviewer source(s):
cl...@chromium.org is from context(googleclient/chrome/chromium_gwsq/ipc/config.gwsq)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
| Commit-Queue | +2 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
15 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: chrome/browser/actor/tools/attempt_otp_filling_tool_browsertest.cc
Insertions: 2, Deletions: 1.
The diff is too large to show. Please review the diff.
```
[OTP] Define and map OTP filling ActionResultCodes
This CL defines Mojo ActionResultCodes for OTP retrieval and filling
errors, registers them in UMA enums.xml, and maps
OneTimeTokenRetrievalError to the corresponding Mojo codes in
AttemptOtpFillingTool.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
default:
break;I think that you might regret this if OneTimeTokenRetrievalError grows.
As a minimum I would write
```
message = base::StringPrintF("An error occurred during OTP retrieval: %d",
std::to_underlying(result.error()));
```
Alternatively replace the default cases with a list of all cases so that you learn if a new error code is added.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |