-
Notifications
You must be signed in to change notification settings - Fork 331
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
IgnoreDecodeErrors
: log decoding error
#2778
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NachoSoto
force-pushed
the
ignore-decode-errors-log
branch
from
July 10, 2023 22:42
adc3d19
to
7d32e8b
Compare
tonidero
approved these changes
Jul 11, 2023
We get a lot of flaky failures in CI due to `TestLogHandler` exceeding its duration. I haven't been able reproduce that locally, but it's likely due to the fact that it relies on the autorelease pool releasing the instance, which in turn removes the `LogMessageObserver`. To fix that, this PR avoids creating custom `TestLogHandler` that rely on the lifetime of the test, and instead explicitly set it to `nil` in `tearDown`. I implemented that in `TestCase` (now also available for backend tests) so all our test classes can take advantage of that.
This has exposed the |
NachoSoto
force-pushed
the
ignore-decode-errors-log
branch
from
July 11, 2023 16:59
7d32e8b
to
85c9fb2
Compare
NachoSoto
force-pushed
the
ignore-decode-errors-log
branch
from
July 11, 2023 17:18
85c9fb2
to
4b16415
Compare
NachoSoto
force-pushed
the
ignore-decode-errors-log
branch
from
July 11, 2023 17:55
4b16415
to
c700033
Compare
This will be used for decoding the upcoming paywall data. If we end up with values that we can't parse (like an unknown template), we need to be able to see that in the logs instead of just decoding no paywalls. I made this `debug` since we expected it and recovered from it. This also improves the error. Before: ``` DEBUG: ℹ️ Couldn't decode data from json. Error: The data couldn’t be read because it isn’t in the correct format. ``` After: ``` [codable] DEBUG: ℹ️ Couldn't decode 'E' from json. Error: Swift.DecodingError.dataCorrupted(Swift.DecodingError.Context(codingPath: [CodingKeys(stringValue: "e", intValue: nil)], debugDescription: "Cannot initialize E from invalid String value e3", underlyingError: nil)) ```
NachoSoto
force-pushed
the
ignore-decode-errors-log
branch
from
July 11, 2023 17:56
c700033
to
e7d4877
Compare
Codecov Report
@@ Coverage Diff @@
## test-log-handler-lifetime #2778 +/- ##
==========================================================
Coverage 86.48% 86.48%
==========================================================
Files 214 214
Lines 15379 15379
==========================================================
Hits 13300 13300
Misses 2079 2079 |
NachoSoto
added a commit
that referenced
this pull request
Jul 12, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases - Made `DefaultDecodable` and `AnyDecodable` `Sendable`
NachoSoto
added a commit
that referenced
this pull request
Jul 13, 2023
### Changes: - Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 13, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 13, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 13, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 20, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 23, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 24, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 24, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 25, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 26, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 27, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Jul 31, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 3, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 7, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 9, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 11, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 14, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 17, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 24, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 28, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Aug 31, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 1, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 6, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 6, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 6, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 7, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 8, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 14, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 14, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
NachoSoto
added a commit
that referenced
this pull request
Sep 15, 2023
- Added `Offering.paywall` - Decoding `PaywallData` in `OfferingsResponse`, using `IgnoreDecodeErrors` (this will be better after #2778) - New `PaywallData` `struct` - Added new APIs to testers - Testing paywall deserialization from `Offerings` - Testing paywall deserialization separately to check edge cases
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This will be used for decoding the upcoming paywall data.
If we end up with values that we can't parse (like an unknown template), we need to be able to see that in the logs instead of just decoding no paywalls.
I made this
debug
since we expected it and recovered from it.This also improves the error.
Before:
After: