-
-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user feedback capability to the Native SDK (#966)
- Loading branch information
1 parent
9b1bc43
commit fda2a37
Showing
13 changed files
with
238 additions
and
3 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,35 @@ SENTRY_TEST(basic_http_request_preparation_for_transaction) | |
sentry__dsn_decref(dsn); | ||
} | ||
|
||
SENTRY_TEST(basic_http_request_preparation_for_user_feedback) | ||
{ | ||
sentry_dsn_t *dsn = sentry__dsn_new("https://[email protected]/42"); | ||
|
||
sentry_uuid_t event_id | ||
= sentry_uuid_from_string("c993afb6-b4ac-48a6-b61b-2558e601d65d"); | ||
sentry_envelope_t *envelope = sentry__envelope_new(); | ||
sentry_value_t user_feedback = sentry_value_new_user_feedback( | ||
&event_id, "some-name", "some-email", "some-comment"); | ||
sentry__envelope_add_user_feedback(envelope, user_feedback); | ||
|
||
sentry_prepared_http_request_t *req | ||
= sentry__prepare_http_request(envelope, dsn, NULL, NULL); | ||
TEST_CHECK_STRING_EQUAL(req->method, "POST"); | ||
TEST_CHECK_STRING_EQUAL( | ||
req->url, "https://sentry.invalid:443/api/42/envelope/"); | ||
TEST_CHECK_STRING_EQUAL(req->body, | ||
"{\"event_id\":\"c993afb6-b4ac-48a6-b61b-2558e601d65d\"}\n" | ||
"{\"type\":\"user_report\",\"length\":117}\n" | ||
"{\"event_id\":\"c993afb6-b4ac-48a6-b61b-2558e601d65d\",\"name\":" | ||
"\"some-name\",\"email\":\"some-email\",\"comments\":" | ||
"\"some-comment\"}"); | ||
sentry__prepared_http_request_free(req); | ||
sentry_value_decref(user_feedback); | ||
sentry_envelope_free(envelope); | ||
|
||
sentry__dsn_decref(dsn); | ||
} | ||
|
||
SENTRY_TEST(basic_http_request_preparation_for_event_with_attachment) | ||
{ | ||
sentry_dsn_t *dsn = sentry__dsn_new("https://[email protected]/42"); | ||
|
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
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