Unverified Commit d075d647 authored by Devon Carew's avatar Devon Carew Committed by GitHub

remove the unused hintMessage and hintId fields from the reload results (#31267)

parent 80971335
...@@ -78,7 +78,7 @@ It is up to the client to decide how best to display the message; for some clien ...@@ -78,7 +78,7 @@ It is up to the client to decide how best to display the message; for some clien
#### app.restart #### app.restart
The `restart()` restarts the given application. It returns a Map of `{ int code, String message, String hintMessage, String hintId }` to indicate success or failure in restarting the app. A `code` of `0` indicates success, and non-zero indicates a failure. If `hintId` is non-null and equal to `restartRecommended`, that indicates that the reload was successful, but not all reloaded elements were executed during view reassembly (i.e., the user might not see all the changes in the current UI, and a restart could be necessary). The `restart()` restarts the given application. It returns a Map of `{ int code, String message }` to indicate success or failure in restarting the app. A `code` of `0` indicates success, and non-zero indicates a failure.
- `appId`: the id of a previously started app; this is required. - `appId`: the id of a previously started app; this is required.
- `fullRestart`: optional; whether to do a full (rather than an incremental) restart of the application - `fullRestart`: optional; whether to do a full (rather than an incremental) restart of the application
......
...@@ -722,17 +722,10 @@ Map<String, dynamic> _emulatorToMap(Emulator emulator) { ...@@ -722,17 +722,10 @@ Map<String, dynamic> _emulatorToMap(Emulator emulator) {
} }
Map<String, dynamic> _operationResultToMap(OperationResult result) { Map<String, dynamic> _operationResultToMap(OperationResult result) {
final Map<String, dynamic> map = <String, dynamic>{ return <String, dynamic>{
'code': result.code, 'code': result.code,
'message': result.message, 'message': result.message,
}; };
if (result.hintMessage != null)
map['hintMessage'] = result.hintMessage;
if (result.hintId != null)
map['hintId'] = result.hintId;
return map;
} }
dynamic _toJsonable(dynamic obj) { dynamic _toJsonable(dynamic obj) {
......
...@@ -1017,7 +1017,7 @@ abstract class ResidentRunner { ...@@ -1017,7 +1017,7 @@ abstract class ResidentRunner {
} }
class OperationResult { class OperationResult {
OperationResult(this.code, this.message, { this.hintMessage, this.hintId }); OperationResult(this.code, this.message);
/// The result of the operation; a non-zero code indicates a failure. /// The result of the operation; a non-zero code indicates a failure.
final int code; final int code;
...@@ -1025,17 +1025,6 @@ class OperationResult { ...@@ -1025,17 +1025,6 @@ class OperationResult {
/// A user facing message about the results of the operation. /// A user facing message about the results of the operation.
final String message; final String message;
/// An optional hint about the results of the operation. This is used to provide
/// sidecar data about the operation results. For example, this is used when
/// a reload is successful but some changed program elements where not run after a
/// reassemble.
final String hintMessage;
/// A key used by tools to discriminate between different kinds of operation results.
/// For example, a successful reload might have a [code] of 0 and a [hintId] of
/// `'restartRecommended'`.
final String hintId;
bool get isOk => code == 0; bool get isOk => code == 0;
static final OperationResult ok = OperationResult(0, ''); static final OperationResult ok = OperationResult(0, '');
......
...@@ -586,8 +586,6 @@ class HotRunner extends ResidentRunner { ...@@ -586,8 +586,6 @@ class HotRunner extends ResidentRunner {
printStatus('${result.message}.'); printStatus('${result.message}.');
} }
} }
if (result.hintMessage != null)
printStatus('\n${result.hintMessage}');
return result; return result;
} }
} }
......
...@@ -293,10 +293,6 @@ void main() { ...@@ -293,10 +293,6 @@ void main() {
jsonEncodeObject(OperationResult(1, 'foo')), jsonEncodeObject(OperationResult(1, 'foo')),
'{"code":1,"message":"foo"}', '{"code":1,"message":"foo"}',
); );
expect(
jsonEncodeObject(OperationResult(0, 'foo', hintMessage: 'my hint', hintId: 'myId')),
'{"code":0,"message":"foo","hintMessage":"my hint","hintId":"myId"}',
);
}); });
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment