Merge pull request #849 from pangeachat/sentry

Sentry
pull/1476/head
ggurdin 1 year ago committed by GitHub
commit 7ae4d08bac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,5 +1,6 @@
import 'package:collection/collection.dart';
import 'package:fluffychat/config/app_config.dart';
import 'package:fluffychat/pangea/config/environment.dart';
import 'package:fluffychat/pangea/controllers/language_list_controller.dart';
import 'package:fluffychat/pangea/utils/error_handler.dart';
import 'package:fluffychat/pangea/utils/firebase_analytics.dart';
@ -100,6 +101,18 @@ Future<void> startGui(List<Client> clients, SharedPreferences store) async {
await firstClient?.accountDataLoading;
ErrorWidget.builder = (details) => FluffyChatErrorWidget(details);
// #Pangea
// errors seems to happen a lot when users switch better production / staging
// while testing by accident. If the account is a production account but server is
// staging or vice versa, logout.
final isStagingUser = firstClient?.userID?.domain?.contains("staging");
final isStagingServer = Environment.isStaging;
if (isStagingServer != isStagingUser) {
await firstClient?.logout();
}
// Pangea#
runApp(FluffyChatApp(clients: clients, pincode: pin, store: store));
}

@ -593,6 +593,7 @@ class Choreographer {
if (isFetching) return false;
if (errorService.isError) return true;
if (itEnabled && isRunningIT) return false;
if (igc.igcTextData == null) return false;
final hasITMatches =
igc.igcTextData!.matches.any((match) => match.isITStart);

@ -103,7 +103,7 @@ class ITFeedbackCardController extends State<ITFeedbackCard> {
@override
Widget build(BuildContext context) => error == null
? ITFeedbackCardView(controller: this)
: CardErrorWidget(error: error);
: CardErrorWidget(error: error!);
}
class ITFeedbackCardView extends StatelessWidget {

@ -56,7 +56,10 @@ class ChoreographerSendButtonState extends State<ChoreographerSendButton> {
color: widget.controller.choreographer.assistanceState
.stateColor(context),
onPressed: () {
widget.controller.choreographer.send(context);
widget.controller.choreographer.canSendMessage
? widget.controller.choreographer.send(context)
: widget.controller.choreographer.igc
.showFirstMatch(context);
},
tooltip: L10n.of(context)!.send,
),

@ -10,7 +10,7 @@ extension AnalyticsRoomExtension on Room {
return;
}
if (!isRoomAdmin) return;
if (client.userID == null || !isRoomAdmin) return;
final spaceHierarchy = await client.getSpaceHierarchy(
id,
maxDepth: 1,

@ -152,7 +152,7 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
// done fetchig but not results means some kind of error
if (speechToTextResponse == null) {
return CardErrorWidget(
error: error,
error: error ?? "Failed to fetch speech to text",
maxWidth: AppConfig.toolbarMinWidth,
);
}

@ -6,14 +6,14 @@ import 'package:fluffychat/pangea/widgets/igc/card_header.dart';
import 'package:flutter/material.dart';
class CardErrorWidget extends StatelessWidget {
final Object? error;
final Object error;
final Choreographer? choreographer;
final int? offset;
final double? maxWidth;
const CardErrorWidget({
super.key,
this.error,
required this.error,
this.choreographer,
this.offset,
this.maxWidth,

@ -167,7 +167,7 @@ class WordDataCardView extends StatelessWidget {
Widget build(BuildContext context) {
if (controller.wordNetError != null) {
return CardErrorWidget(
error: controller.wordNetError,
error: controller.wordNetError!,
maxWidth: AppConfig.toolbarMinWidth,
);
}

@ -6,7 +6,7 @@ description: Learn a language while texting your friends.
# Pangea#
publish_to: none
# On version bump also increase the build number for F-Droid
version: 1.22.8+3558
version: 1.22.9+3559
environment:
sdk: ">=3.0.0 <4.0.0"

Loading…
Cancel
Save