Skip to content

test: Add FCM payload validation integration tests#119

Merged
akalex merged 6 commits intomasterfrom
feature/Add-FCM-payload-validation-integation-tests
Apr 1, 2026
Merged

test: Add FCM payload validation integration tests#119
akalex merged 6 commits intomasterfrom
feature/Add-FCM-payload-validation-integation-tests

Conversation

@akalex
Copy link
Copy Markdown
Member

@akalex akalex commented Apr 1, 2026

Sends real messages to FCM with dry_run=True to catch serialization bugs (like the VISIBILITY_PRIVATE incident) in CI before production.

Covers standard and silent payloads for both Android and APNS. Tests are skipped when FIREBASE_SERVICE_ACCOUNT_KEY is not set.

Sends real messages to FCM with dry_run=True to catch serialization
bugs (like the `VISIBILITY_PRIVATE` incident) in CI before production.

Covers standard and silent payloads for both Android and APNS.
Tests are skipped when `FIREBASE_SERVICE_ACCOUNT_KEY` is not set.
@akalex akalex self-assigned this Apr 1, 2026
akalex added 5 commits April 1, 2026 13:28
FCM rejects fake tokens with INVALID_ARGUMENT "registration token is
not valid" rather than NOT_FOUND. Distinguish token rejection from
payload rejection by checking the error message.
Replaces single negative test with parametrized cases covering all
four serialization bugs fixed in 6.0.2: VISIBILITY_ prefix, lowercase
visibility, wrong key for priority, wrong key for event_time.
FCM short-circuits on token validation before checking the payload,
making fake-token tests unreliable. Switching to topic-addressed
messages ensures FCM validates the full payload on dry_run.
FCM accepts lowercase enum values like "private" — it's not
case-sensitive. Only the VISIBILITY_ prefix is actually rejected.
@akalex akalex merged commit 2ac0c9a into master Apr 1, 2026
17 checks passed
@akalex akalex deleted the feature/Add-FCM-payload-validation-integation-tests branch April 1, 2026 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant