Skip to content

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented May 6, 2025

📜 Description

Supabase instrumentation for database operations (no auth instrumentation)

  • Breadcrumbs
  • Body Redaction
  • Tracing
  • Errors
  • PII (Body, Query)

💡 Motivation and Context

Closes #2727

💚 How did you test it?

Unit tests.

📝 Checklist

  • I reviewed submitted code
  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPii is enabled
  • I updated the docs if needed
  • All tests passing
  • No breaking changes

Copy link
Contributor

github-actions bot commented May 6, 2025

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against 7e9d32c

Copy link

codecov bot commented May 6, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.96%. Comparing base (40c8f93) to head (b0f288d).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2913      +/-   ##
==========================================
+ Coverage   87.84%   87.96%   +0.11%     
==========================================
  Files         290      290              
  Lines       10003    10003              
==========================================
+ Hits         8787     8799      +12     
+ Misses       1216     1204      -12     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented May 6, 2025

Android Performance metrics 🚀

  Plain With Sentry Diff
Startup time 462.92 ms 452.48 ms -10.44 ms
Size 13.93 MiB 15.00 MiB 1.06 MiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
6b69699 456.06 ms 557.44 ms 101.38 ms
192b44c 472.26 ms 477.34 ms 5.08 ms
1f639ee 429.98 ms 476.60 ms 46.62 ms
6f47800 451.04 ms 509.64 ms 58.60 ms
7cfee3b 498.78 ms 516.98 ms 18.20 ms
7cfbbd6 499.69 ms 592.24 ms 92.55 ms
73dca78 476.53 ms 522.21 ms 45.68 ms
32914d8 461.96 ms 495.47 ms 33.51 ms
2cf9161 454.12 ms 512.67 ms 58.55 ms
6bcdc99 440.23 ms 435.77 ms -4.46 ms

App size

Revision Plain With Sentry Diff
6b69699 6.54 MiB 7.70 MiB 1.17 MiB
192b44c 13.93 MiB 14.93 MiB 1.00 MiB
1f639ee 13.93 MiB 15.00 MiB 1.06 MiB
6f47800 6.54 MiB 7.69 MiB 1.15 MiB
7cfee3b 6.54 MiB 7.70 MiB 1.17 MiB
7cfbbd6 6.54 MiB 7.70 MiB 1.17 MiB
73dca78 6.54 MiB 7.69 MiB 1.15 MiB
32914d8 6.54 MiB 7.70 MiB 1.16 MiB
2cf9161 6.54 MiB 7.70 MiB 1.16 MiB
6bcdc99 13.93 MiB 15.00 MiB 1.06 MiB

Previous results on branch: feat/supabase

Startup times

Revision Plain With Sentry Diff
6a8651f 476.65 ms 532.62 ms 55.96 ms
5454931 447.86 ms 439.08 ms -8.78 ms
8bd9497 470.21 ms 524.26 ms 54.05 ms
ecfbb1d 479.15 ms 537.30 ms 58.15 ms
e4d1bf6 499.64 ms 528.47 ms 28.82 ms
0ab2edd 459.85 ms 506.63 ms 46.77 ms
2db18e6 470.42 ms 473.86 ms 3.43 ms
1476f86 477.10 ms 480.87 ms 3.77 ms
5e3ca91 451.24 ms 496.74 ms 45.50 ms
d2f4fd9 453.31 ms 507.02 ms 53.71 ms

App size

Revision Plain With Sentry Diff
6a8651f 6.54 MiB 7.53 MiB 1015.94 KiB
5454931 13.93 MiB 15.00 MiB 1.06 MiB
8bd9497 6.44 MiB 7.43 MiB 1013.21 KiB
ecfbb1d 6.54 MiB 7.71 MiB 1.17 MiB
e4d1bf6 6.44 MiB 7.44 MiB 1017.53 KiB
0ab2edd 6.54 MiB 7.53 MiB 1016.33 KiB
2db18e6 13.93 MiB 14.93 MiB 1.00 MiB
1476f86 13.93 MiB 14.93 MiB 1.00 MiB
5e3ca91 6.44 MiB 7.44 MiB 1017.53 KiB
d2f4fd9 6.54 MiB 7.53 MiB 1017.45 KiB

Copy link
Contributor

github-actions bot commented May 6, 2025

iOS Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1261.51 ms 1264.02 ms 2.51 ms
Size 5.53 MiB 6.00 MiB 479.95 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
aeb02f2 1244.29 ms 1256.55 ms 12.26 ms
54acf91 1257.65 ms 1277.96 ms 20.31 ms
73a3c38 1263.37 ms 1277.90 ms 14.53 ms
944b773 1252.82 ms 1254.08 ms 1.27 ms
827bf09 1261.86 ms 1276.41 ms 14.55 ms
192b44c 1269.08 ms 1275.52 ms 6.44 ms
c1e775e 1263.08 ms 1275.32 ms 12.24 ms
cf443d2 1255.79 ms 1248.38 ms -7.40 ms
81f83eb 1259.53 ms 1273.39 ms 13.86 ms
0fb3800 1256.60 ms 1266.28 ms 9.68 ms

App size

Revision Plain With Sentry Diff
aeb02f2 7.86 MiB 9.44 MiB 1.58 MiB
54acf91 20.70 MiB 22.46 MiB 1.75 MiB
73a3c38 7.86 MiB 9.44 MiB 1.58 MiB
944b773 5.53 MiB 6.00 MiB 479.98 KiB
827bf09 7.86 MiB 9.44 MiB 1.58 MiB
192b44c 5.53 MiB 5.96 MiB 444.33 KiB
c1e775e 20.70 MiB 22.46 MiB 1.75 MiB
cf443d2 5.53 MiB 6.00 MiB 479.99 KiB
81f83eb 7.86 MiB 9.44 MiB 1.58 MiB
0fb3800 7.86 MiB 9.44 MiB 1.58 MiB

Previous results on branch: feat/supabase

Startup times

Revision Plain With Sentry Diff
6a8651f 1254.15 ms 1266.88 ms 12.73 ms
0a08454 1265.15 ms 1283.18 ms 18.04 ms
0ab2edd 1254.71 ms 1264.28 ms 9.56 ms
5454931 1266.92 ms 1270.20 ms 3.29 ms
f8ec07b 1259.06 ms 1273.22 ms 14.16 ms
e4d1bf6 1249.16 ms 1267.12 ms 17.96 ms
77c7ea9 1264.57 ms 1279.47 ms 14.89 ms
34b0923 1269.29 ms 1275.88 ms 6.59 ms
d2f4fd9 1252.60 ms 1271.13 ms 18.52 ms
2db18e6 1274.85 ms 1276.16 ms 1.31 ms

App size

Revision Plain With Sentry Diff
6a8651f 7.85 MiB 9.42 MiB 1.57 MiB
0a08454 8.43 MiB 10.01 MiB 1.58 MiB
0ab2edd 7.85 MiB 9.45 MiB 1.59 MiB
5454931 5.53 MiB 6.00 MiB 479.95 KiB
f8ec07b 7.86 MiB 9.44 MiB 1.58 MiB
e4d1bf6 8.43 MiB 10.00 MiB 1.56 MiB
77c7ea9 7.86 MiB 9.44 MiB 1.58 MiB
34b0923 8.43 MiB 10.01 MiB 1.58 MiB
d2f4fd9 7.86 MiB 9.45 MiB 1.59 MiB
2db18e6 5.53 MiB 5.97 MiB 453.77 KiB

cursor[bot]

This comment was marked as outdated.

# Conflicts:
#	.craft.yml
#	packages/flutter/example/pubspec_overrides.yaml
cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

);
}
}
return response;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Mismatched Nullability in Error Client Method

The SentrySupabaseErrorClient.send method declares response as nullable (StreamedResponse? response), but its return type is non-nullable (Future<StreamedResponse>). This creates a potential mismatch in nullability.

Additional Locations (1)

Fix in Cursor Fix in Web

final bool _enableTracing;
final bool _enableErrors;

Client _innerClient;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Mutable Client in Constructor

The _innerClient field is not final and is reassigned multiple times within the constructor. This makes the client mutable, which could lead to unexpected behavior.

Fix in Cursor Fix in Web

}
}

return conditions.join(' AND ').replaceAll(' AND OR ', ' OR ');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: String Replacement Error in SQL Query Construction

The _buildWhereClause method uses replaceAll(' AND OR ', ' OR ') to combine conditions. This global string replacement can incorrectly modify column names or values that contain the substring " AND OR ", leading to malformed SQL queries.

Fix in Cursor Fix in Web

span.setData('db.operation', supabaseRequest.operation.value);
span.setData('db.sql.query', supabaseRequest.generateSqlQuery());
// ignore: invalid_use_of_internal_member
span.setData('origin', SentryTraceOrigins.autoDbSupabase);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Span Origin Key Mismatch

Automated spans for Supabase requests set the origin attribute, but the expected key for automated instrumentation is sentry.origin.

Fix in Cursor Fix in Web

@buenaflor
Copy link
Contributor

@denrase could you have a look at cursor comments pls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supabase Support

2 participants