@@ -72,25 +72,33 @@ class SentrySupabaseClient extends BaseClient {
72
72
final url = request.url;
73
73
final table = url.pathSegments.last;
74
74
final description = 'from($table )' ;
75
+ final query = _readQuery (request);
76
+ final body = _readBody (table, request);
75
77
76
- final query = < String > [];
77
- for (final entry in request.url.queryParameters.entries) {
78
- query.add (_translateFiltersIntoMethods (entry.key, entry.value));
78
+ if (_breadcrumbs) {
79
+ _addBreadcrumb (description, operation, query, body);
79
80
}
81
+ }
82
+
83
+ List <String > _readQuery (BaseRequest request) {
84
+ return request.url.queryParameters.entries
85
+ .map (
86
+ (entry) => _translateFiltersIntoMethods (entry.key, entry.value),
87
+ )
88
+ .toList ();
89
+ }
80
90
91
+ Map <String , dynamic >? _readBody (String table, BaseRequest request) {
81
92
final bodyString =
82
93
request is Request && request.body.isNotEmpty ? request.body : null ;
83
94
var body = bodyString != null ? jsonDecode (bodyString) : null ;
84
95
85
- if (_redactRequestBody != null ) {
86
- for (final entry in body? .entries ?? [] ) {
96
+ if (body != null && _redactRequestBody != null ) {
97
+ for (final entry in body.entries) {
87
98
body[entry.key] = _redactRequestBody (table, entry.key, entry.value);
88
99
}
89
100
}
90
-
91
- if (_breadcrumbs) {
92
- _addBreadcrumb (description, operation, query, body);
93
- }
101
+ return body;
94
102
}
95
103
96
104
void _addBreadcrumb (
0 commit comments