Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t force cast to NSComparisonPredicate in TERNARY operator #4232

Merged
merged 4 commits into from
Aug 6, 2024

Conversation

denrase
Copy link
Collaborator

@denrase denrase commented Aug 5, 2024

📜 Description

Tenary operators can contain any type of predicate, not just comparison. Removed the force cast and called the parent method for the description.

💡 Motivation and Context

Fixes #3553

💚 How did you test it?

📝 Checklist

You have to check all boxes before merging:

  • I reviewed the submitted code.
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

@denrase denrase changed the title Don’t force cast to NSComparisonPredicate Don’t force cast to NSComparisonPredicate Aug 5, 2024
@denrase denrase changed the title Don’t force cast to NSComparisonPredicate Don’t force cast to NSComparisonPredicate in tenary operator Aug 5, 2024
@denrase denrase changed the title Don’t force cast to NSComparisonPredicate in tenary operator Don’t force cast to NSComparisonPredicate in TERNARY operator Aug 5, 2024
@denrase denrase marked this pull request as ready for review August 5, 2024 12:42
Copy link
Member

@philipphofmann philipphofmann left a comment

Choose a reason for hiding this comment

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

Thank you @denrase 💯. LGTM

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.375%. Comparing base (76c2ac7) to head (02e7cab).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##              main     #4232       +/-   ##
=============================================
- Coverage   91.445%   91.375%   -0.070%     
=============================================
  Files          611       610        -1     
  Lines        49214     49117       -97     
  Branches     17781     17698       -83     
=============================================
- Hits         45004     44881      -123     
- Misses        4116      4143       +27     
+ Partials        94        93        -1     
Files Coverage Δ
Sources/Sentry/SentryPredicateDescriptor.m 95.652% <100.000%> (-0.047%) ⬇️
...s/SentryTests/SentryPredicateDescriptorTests.swift 94.186% <100.000%> (+0.210%) ⬆️

... and 22 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 76c2ac7...02e7cab. Read the comment docs.

Copy link

github-actions bot commented Aug 5, 2024

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 1228.96 ms 1247.50 ms 18.54 ms
Size 21.58 KiB 695.48 KiB 673.90 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
2af280d 1226.46 ms 1229.81 ms 3.35 ms
17afc4b 1228.94 ms 1251.10 ms 22.16 ms
1437c68 1223.94 ms 1249.76 ms 25.82 ms
60d6cec 1257.14 ms 1273.92 ms 16.78 ms
19b93f9 1212.46 ms 1226.86 ms 14.40 ms
6001822 1234.49 ms 1265.20 ms 30.71 ms
d80d410 1231.50 ms 1240.14 ms 8.64 ms
01a28a9 1245.43 ms 1255.98 ms 10.55 ms
33b2f51 1251.24 ms 1259.18 ms 7.94 ms
b6ba04e 1217.45 ms 1248.92 ms 31.47 ms

App size

Revision Plain With Sentry Diff
2af280d 20.76 KiB 435.22 KiB 414.46 KiB
17afc4b 20.76 KiB 436.25 KiB 415.49 KiB
1437c68 22.85 KiB 410.96 KiB 388.11 KiB
60d6cec 22.84 KiB 403.51 KiB 380.67 KiB
19b93f9 21.58 KiB 694.46 KiB 672.88 KiB
6001822 22.85 KiB 410.98 KiB 388.13 KiB
d80d410 20.76 KiB 425.71 KiB 404.95 KiB
01a28a9 22.85 KiB 405.39 KiB 382.55 KiB
33b2f51 20.76 KiB 432.17 KiB 411.41 KiB
b6ba04e 20.76 KiB 414.45 KiB 393.69 KiB

@denrase
Copy link
Collaborator Author

denrase commented Aug 5, 2024

There are some test failures, but it's not obvious to me how they relate to this PR. For example

SentryProfilerTests
  testTraceProfilerCanBeInitializedOffMainThread, Asynchronous wait failed: Exceeded timeout of 1 seconds, with unfulfilled expectations: "background initializing profiler".
  /Users/runner/work/sentry-cocoa/sentry-cocoa/Tests/SentryProfilerTests/SentryProfilerTests.mm:62
});
[self waitForExpectationsWithTimeout:1.0
                             handler:^(NSError *_Nullable error) { NSLog(@"%@", error); }];

Are these just flaky @philipphofmann ?

@denrase denrase merged commit de3c570 into main Aug 6, 2024
62 of 68 checks passed
@denrase denrase deleted the fix/swift-data-predicate branch August 6, 2024 08:01
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.

SwiftData: NSCompoundPredicate predicateOperatorType: unrecognized selector sent to instance
4 participants