ab:deal push error, show error banner, fix splash empty by remove reset

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-08-13 14:46:04 +08:00
parent 5112398ad3
commit b2f5e2f927
40 changed files with 262 additions and 98 deletions

View File

@ -45,12 +45,17 @@ class _AddressBookState extends State<AddressBook> {
child: CircularProgressIndicator(),
);
}
if (gFFI.abModel.abError.isNotEmpty) {
return _buildShowError(gFFI.abModel.abError.value);
}
return Column(
children: [
_buildLoadingHavingPeers(),
_buildNotEmptyLoading(),
_buildErrorBanner(
err: gFFI.abModel.pullError,
retry: null,
close: () => gFFI.abModel.pullError.value = ''),
_buildErrorBanner(
err: gFFI.abModel.pushError,
retry: () => gFFI.abModel.pushAb(),
close: () => gFFI.abModel.pushError.value = ''),
Expanded(
child: isDesktop
? _buildAddressBookDesktop()
@ -60,22 +65,62 @@ class _AddressBookState extends State<AddressBook> {
}
});
Widget _buildShowError(String error) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(translate(error)),
TextButton(
onPressed: () {
gFFI.abModel.pullAb();
},
child: Text(translate("Retry")))
],
));
Widget _buildErrorBanner(
{required RxString err,
required Function? retry,
required Function close}) {
const double height = 25;
return Obx(() => Offstage(
offstage: !(!gFFI.abModel.abLoading.value && err.value.isNotEmpty),
child: Center(
child: Container(
height: height,
color: Color.fromARGB(255, 253, 238, 235),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
FittedBox(
child: Icon(
Icons.info,
color: Color.fromARGB(255, 249, 81, 81),
),
).marginAll(4),
Flexible(
child: Align(
alignment: Alignment.centerLeft,
child: Tooltip(
message: translate(err.value),
child: Text(
translate(err.value),
overflow: TextOverflow.ellipsis,
),
)).marginSymmetric(vertical: 2),
),
if (retry != null)
InkWell(
onTap: () {
retry.call();
},
child: Text(
translate("Retry"),
style: TextStyle(color: MyTheme.accent),
)).marginSymmetric(horizontal: 5),
FittedBox(
child: InkWell(
onTap: () {
close.call();
},
child: Icon(Icons.close).marginSymmetric(horizontal: 5),
),
).marginAll(4)
],
),
)).marginOnly(bottom: 14),
));
}
Widget _buildLoadingHavingPeers() {
Widget _buildNotEmptyLoading() {
double size = 15;
return Obx(() => Offstage(
offstage: !(gFFI.abModel.abLoading.value && !gFFI.abModel.emtpy),

View File

@ -229,13 +229,14 @@ class _PeerCardState extends State<_PeerCard>
: '',
child: Stack(children: [
child,
Positioned(
top: 2,
right: 10,
child: CustomPaint(
painter: TagPainter(radius: 3, colors: colors),
),
)
if (colors.isNotEmpty)
Positioned(
top: 2,
right: 10,
child: CustomPaint(
painter: TagPainter(radius: 3, colors: colors),
),
)
]),
);
}
@ -329,13 +330,14 @@ class _PeerCardState extends State<_PeerCard>
: '',
child: Stack(children: [
child,
Positioned(
top: 4,
right: 12,
child: CustomPaint(
painter: TagPainter(radius: 4, colors: colors),
),
)
if (colors.isNotEmpty)
Positioned(
top: 4,
right: 12,
child: CustomPaint(
painter: TagPainter(radius: 4, colors: colors),
),
)
]),
);
}

View File

@ -125,6 +125,7 @@ void runMainApp(bool startService) async {
bind.pluginSyncUi(syncTo: kAppTypeMain);
bind.pluginListReload();
}
gFFI.abModel.loadCache();
gFFI.userModel.refreshCurrentUser();
runApp(App());
// Set window option.
@ -152,6 +153,7 @@ void runMobileApp() async {
await initEnv(kAppTypeMain);
if (isAndroid) androidChannelInit();
platformFFI.syncAndroidServiceAppDirConfigPath();
gFFI.abModel.loadCache();
gFFI.userModel.refreshCurrentUser();
runApp(App());
}

View File

@ -5,6 +5,7 @@ import 'dart:io';
import 'package:flutter/material.dart';
import 'package:flutter_hbb/models/model.dart';
import 'package:flutter_hbb/models/peer_model.dart';
import 'package:flutter_hbb/models/peer_tab_model.dart';
import 'package:flutter_hbb/models/platform_model.dart';
import 'package:get/get.dart';
import 'package:bot_toast/bot_toast.dart';
@ -24,7 +25,8 @@ bool shouldSortTags() {
class AbModel {
final abLoading = false.obs;
final abError = "".obs;
final pullError = "".obs;
final pushError = "".obs;
final tags = [].obs;
final peers = List<Peer>.empty(growable: true).obs;
final sortTags = shouldSortTags().obs;
@ -33,8 +35,10 @@ class AbModel {
final selectedTags = List<String>.empty(growable: true).obs;
var initialized = false;
var licensedDevices = 0;
var sync_all_from_recent = true;
var _syncAllFromRecent = true;
var _syncFromRecentLock = false;
var _timerCounter = 0;
var _cacheLoadOnceFlag = false;
WeakReference<FFI> parent;
@ -51,12 +55,15 @@ class AbModel {
if (gFFI.userModel.userName.isEmpty) return;
if (abLoading.value) return;
if (!force && initialized) return;
if (!initialized) {
await _loadCache();
if (pushError.isNotEmpty) {
try {
// push to retry
pushAb(toast: false);
} catch (_) {}
}
if (!quiet) {
abLoading.value = true;
abError.value = "";
pullError.value = "";
}
final api = "${await bind.mainGetApiServer()}/api/ab";
int? statusCode;
@ -66,19 +73,22 @@ class AbModel {
authHeaders['Accept-Encoding'] = "gzip";
final resp = await http.get(Uri.parse(api), headers: authHeaders);
statusCode = resp.statusCode;
if (resp.body.isNotEmpty && resp.body.toLowerCase() != "null") {
if (resp.body.toLowerCase() == "null") {
// normal reply, emtpy ab return null
tags.clear();
peers.clear();
} else if (resp.body.isNotEmpty) {
Map<String, dynamic> json;
try {
json = jsonDecode(utf8.decode(resp.bodyBytes));
} catch (e) {
if (resp.statusCode != 200) {
BotToast.showText(
contentColor: Colors.red, text: 'HTTP ${resp.statusCode}');
throw 'HTTP ${resp.statusCode}, $e';
}
rethrow;
}
if (json.containsKey('error')) {
abError.value = json['error'];
throw json['error'];
} else if (json.containsKey('data')) {
try {
gFFI.abModel.licensedDevices = json['licensed_devices'];
@ -101,7 +111,13 @@ class AbModel {
}
}
} catch (err) {
abError.value = err.toString();
if (!quiet) {
pullError.value =
'${translate('pull_ab_failed_tip')}: ${translate(err.toString())}';
if (gFFI.peerTabModel.currentTab != PeerTabIndex.ab.index) {
BotToast.showText(contentColor: Colors.red, text: pullError.value);
}
}
} finally {
if (initialized) {
// make loading effect obvious
@ -112,26 +128,16 @@ class AbModel {
abLoading.value = false;
}
initialized = true;
sync_all_from_recent = true;
_syncAllFromRecent = true;
_timerCounter = 0;
if (abError.isNotEmpty) {
if (pullError.isNotEmpty) {
if (statusCode == 401) {
gFFI.userModel.reset(clearAbCache: true);
} else {
reset(clearCache: false);
}
}
}
}
Future<void> reset({bool clearCache = false}) async {
await bind.mainSetLocalOption(key: "selected-tags", value: '');
tags.clear();
peers.clear();
initialized = false;
if (clearCache) await bind.mainClearAb();
}
void addId(String id, String alias, List<dynamic> tags) {
if (idContainBy(id)) {
return;
@ -154,8 +160,12 @@ class AbModel {
}
void addPeer(Peer peer) {
peers.removeWhere((e) => e.id == peer.id);
peers.add(peer);
final index = peers.indexWhere((e) => e.id == peer.id);
if (index >= 0) {
peers[index] = merge(peer, peers[index]);
} else {
peers.add(peer);
}
}
void addPeers(List<Peer> ps) {
@ -187,33 +197,58 @@ class AbModel {
}).toList();
}
Future<void> pushAb() async {
Future<void> pushAb({bool toast = true}) async {
debugPrint("pushAb");
final api = "${await bind.mainGetApiServer()}/api/ab";
var authHeaders = getHttpHeaders();
authHeaders['Content-Type'] = "application/json";
final peersJsonData = peers.map((e) => e.toAbUploadJson()).toList();
final body = jsonEncode({
"data": jsonEncode({"tags": tags, "peers": peersJsonData})
});
var request = http.Request('POST', Uri.parse(api));
// support compression
if (licensedDevices > 0 && body.length > 1024) {
authHeaders['Content-Encoding'] = "gzip";
request.bodyBytes = GZipCodec().encode(utf8.encode(body));
} else {
request.body = body;
}
request.headers.addAll(authHeaders);
pushError.value = '';
try {
await http.Client().send(request);
// await pullAb(quiet: true);
_saveCache(); // save on success
// avoid double pushes in a row
_syncAllFromRecent = true;
syncFromRecent(push: false);
final api = "${await bind.mainGetApiServer()}/api/ab";
var authHeaders = getHttpHeaders();
authHeaders['Content-Type'] = "application/json";
final peersJsonData = peers.map((e) => e.toAbUploadJson()).toList();
final body = jsonEncode({
"data": jsonEncode({"tags": tags, "peers": peersJsonData})
});
http.Response resp;
// support compression
if (licensedDevices > 0 && body.length > 1024) {
authHeaders['Content-Encoding'] = "gzip";
resp = await http.post(Uri.parse(api),
headers: authHeaders, body: GZipCodec().encode(utf8.encode(body)));
} else {
resp =
await http.post(Uri.parse(api), headers: authHeaders, body: body);
}
try {
if (resp.statusCode == 200 &&
(resp.body.isEmpty || resp.body.toLowerCase() == 'null')) {
_saveCache();
} else {
final json = jsonDecode(resp.body);
if (json.containsKey('error')) {
throw json['error'];
} else if (resp.statusCode == 200) {
_saveCache();
} else {
throw 'HTTP ${resp.statusCode}';
}
}
} catch (e) {
if (resp.statusCode != 200) {
throw 'HTTP ${resp.statusCode}, $e';
}
rethrow;
}
} catch (e) {
BotToast.showText(contentColor: Colors.red, text: e.toString());
pushError.value =
'${translate('push_ab_failed_tip')}: ${translate(e.toString())}';
if (toast && gFFI.peerTabModel.currentTab != PeerTabIndex.ab.index) {
BotToast.showText(contentColor: Colors.red, text: pushError.value);
}
} finally {
sync_all_from_recent = true;
_timerCounter = 0;
_syncAllFromRecent = true;
}
}
@ -290,21 +325,29 @@ class AbModel {
}
}
void syncFromRecent() async {
Peer merge(Peer r, Peer p) {
return Peer(
id: p.id,
hash: r.hash.isEmpty ? p.hash : r.hash,
username: r.username.isEmpty ? p.username : r.username,
hostname: r.hostname.isEmpty ? p.hostname : r.hostname,
platform: r.platform.isEmpty ? p.platform : r.platform,
alias: r.alias,
tags: p.tags,
forceAlwaysRelay: r.forceAlwaysRelay,
rdpPort: r.rdpPort,
rdpUsername: r.rdpUsername);
}
Peer merge(Peer r, Peer p) {
return Peer(
id: p.id,
hash: r.hash.isEmpty ? p.hash : r.hash,
username: r.username.isEmpty ? p.username : r.username,
hostname: r.hostname.isEmpty ? p.hostname : r.hostname,
platform: r.platform.isEmpty ? p.platform : r.platform,
alias: r.alias,
tags: p.tags,
forceAlwaysRelay: r.forceAlwaysRelay,
rdpPort: r.rdpPort,
rdpUsername: r.rdpUsername);
}
void syncFromRecent({bool push = true}) async {
if (!_syncFromRecentLock) {
_syncFromRecentLock = true;
_syncFromRecentWithoutLock(push: push);
_syncFromRecentLock = false;
}
}
void _syncFromRecentWithoutLock({bool push = true}) async {
bool shouldSync(Peer a, Peer b) {
return a.hash != b.hash ||
a.username != b.username ||
@ -316,8 +359,8 @@ class AbModel {
try {
if (peers.isEmpty) [];
List<String> filteredPeerIDs;
if (sync_all_from_recent) {
sync_all_from_recent = false;
if (_syncAllFromRecent) {
_syncAllFromRecent = false;
filteredPeerIDs = peers.map((e) => e.id).toList();
} else {
final new_stored_str = await bind.mainGetNewStoredPeers();
@ -372,7 +415,7 @@ class AbModel {
}
}
// Be careful with loop calls
if (changed) {
if (changed && push) {
pushAb();
}
} catch (e) {
@ -394,8 +437,10 @@ class AbModel {
}
}
_loadCache() async {
loadCache() async {
try {
if (_cacheLoadOnceFlag || abLoading.value) return;
_cacheLoadOnceFlag = true;
final access_token = bind.mainGetLocalOption(key: 'access_token');
if (access_token.isEmpty) return;
final cache = await bind.mainLoadAb();

View File

@ -87,7 +87,7 @@ class UserModel {
Future<void> reset({bool clearAbCache = false}) async {
await bind.mainSetLocalOption(key: 'access_token', value: '');
await bind.mainSetLocalOption(key: 'user_info', value: '');
await gFFI.abModel.reset(clearCache: clearAbCache);
if (clearAbCache) await bind.mainClearAb();
await gFFI.groupModel.reset();
userName.value = '';
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", "未成功获取地址簿"),
("push_ab_failed_tip", "未成功上传地址簿"),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", "Listenansicht"),
("Select", "Auswählen"),
("Toggle Tags", "Tags umschalten"),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -74,5 +74,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("clipboard_wait_response_timeout_tip", "Timed out waiting for copy response."),
("logout_tip", "Are you sure you want to log out?"),
("exceed_max_devices", "You have reached the maximum number of managed devices."),
("pull_ab_failed_tip", "Failed to refresh address book"),
("push_ab_failed_tip", "Failed to sync address book to server"),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", "Ver en Lista"),
("Select", "Seleccionar"),
("Toggle Tags", "Alternar Etiquetas"),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", "Vista elenco"),
("Select", "Seleziona"),
("Toggle Tags", "Attiva/disattiva tag"),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", "Список"),
("Select", "Выбор"),
("Toggle Tags", "Переключить метки"),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", "未成功獲取地址簿"),
("push_ab_failed_tip", "未成功上傳地址簿"),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}

View File

@ -535,5 +535,7 @@ pub static ref T: std::collections::HashMap<&'static str, &'static str> =
("List View", ""),
("Select", ""),
("Toggle Tags", ""),
("pull_ab_failed_tip", ""),
("push_ab_failed_tip", ""),
].iter().cloned().collect();
}