Skip to content

Commit

Permalink
relax reconstruction error criteria (#959)
Browse files Browse the repository at this point in the history
Co-authored-by: ggurdin <[email protected]>
  • Loading branch information
WilsonLe and ggurdin authored Nov 13, 2024
1 parent af1561b commit 2ddd077
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion lib/pangea/choreographer/controllers/choreographer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ class Choreographer {
// we've got a rather elaborate method of updating tokens after matches are accepted
// so we need to check if the reconstructed text matches the current text
// if not, let's get the tokens again and log an error
final reconstructedText =
PangeaToken.reconstructText(igc.igcTextData!.tokens);
if (igc.igcTextData?.tokens != null &&
PangeaToken.reconstructText(igc.igcTextData!.tokens) != currentText) {
reconstructedText.trim() != currentText.trim()) {
if (kDebugMode) {
PangeaToken.reconstructText(
igc.igcTextData!.tokens,
Expand Down
2 changes: 1 addition & 1 deletion lib/pangea/models/igc_text_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ class IGCTextData {
newTokens.replaceRange(startIndex, endIndex, replacement.tokens);

final String newFullText = PangeaToken.reconstructText(newTokens);
if (newFullText != originalInput && kDebugMode) {
if (newFullText.trim() != originalInput.trim() && kDebugMode) {
PangeaToken.reconstructText(newTokens, debugWalkThrough: true);
ErrorHandler.logError(
m: "reconstructed text not working",
Expand Down

0 comments on commit 2ddd077

Please sign in to comment.