Skip to content

sentry: send envelopes, add drkonqi-sentry-postman, add tests

Harald Sitter requested to merge work/sitter/sentrycache into master

THIS SITS ON TOP OF !126 (merged) and !125 (merged)

this sees some major refactoring to how submissions work.

previously we sent the crash event followed by the user feedback event to their respective ingestion points. sentry does however also feature an alternative format where we can send multiple payloads in the same call. this specifically also allows us to store an entire "submission" in a single file without having to invent anything ourselves.

consequently sentrybeacon is no more, it's been replaced by sentrypostbox which now constructs/manages a sentryenvelope which is representing that new storage format.

an envelope is comprised of a header and payload. the payload are multiple "items" of which each again has a header and a payload of their own. whenever the envelope changes it also updates itself in the sentryenvelopecache.

the cache acts as file-based storage system. the envelope is pushed into the cache which results in a write to ~/.cache/drkonqi/sentry-envelopes/. eventually, once this envelope has been successfully sent to sentry, it is marked sent and moved to a special sent directory. this way we can quickly tell which envelopes are sent already and which require sending still.

to complete the feature there is now a new supplemental systemd service drkonqi-sentry-postman that every once in a while tries to submit pending envelopes. this in particular allows us to collect crashes even when the system is offline and then submit them at a later time via the postman.

Merge request reports