amplitude / Amplitude-Swift

Native iOS/tvOS/macOS/watchOS SDK
MIT License
32 stars 22 forks source link

fix: Fail requests when encoding request body fails. #215

Open crleona opened 2 months ago

crleona commented 2 months ago

Summary

Adds a new failure before trying to send a network request if we cannot encode the request body. Defensively, we will try to re-encode the request body without our diagnostic data in case that is the source of the problem. If this also fails, we delete the invalid events.

This also moves the callback handler for failures to the expected callbackQueue.

TODO: add tests

Checklist