From 3766d28206d39499951ca0a9aba1ef73196cdfe9 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Fri, 14 Jun 2024 10:04:51 -0400 Subject: [PATCH] Fetched choices don't affect cache --- lib/pangea/repo/span_data_repo.dart | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/lib/pangea/repo/span_data_repo.dart b/lib/pangea/repo/span_data_repo.dart index e253bb1d0..a60f2c4e2 100644 --- a/lib/pangea/repo/span_data_repo.dart +++ b/lib/pangea/repo/span_data_repo.dart @@ -80,15 +80,27 @@ class SpanDetailsRepoReqAndRes { bool operator ==(Object other) { if (identical(this, other)) return true; if (other is! SpanDetailsRepoReqAndRes) return false; - - return toJson().toString() == other.toJson().toString(); + if (other.userL1 != userL1) return false; + if (other.userL2 != userL2) return false; + if (other.enableIT != enableIT) return false; + if (other.enableIGC != enableIGC) return false; + if (other.span.message != span.message) return false; + // if (other.span.context != span.context) return false; + return true; } /// Overrides the hashCode getter to generate a hash code for the [SpanDetailsRepoReqAndRes] object. /// Used as keys in response cache in igc_controller. @override int get hashCode { - return toJson().toString().hashCode; + return Object.hashAll([ + userL1.hashCode, + userL2.hashCode, + enableIT.hashCode, + enableIGC.hashCode, + span.message.hashCode, + // span.context.hashCode, + ]); } }