Skip to content

Make filtered-notification integration test idempotent (#144) - #149

Merged
milmazz merged 1 commit into
mainfrom
notification-test-idempotency-144
Jul 16, 2026
Merged

Make filtered-notification integration test idempotent (#144)#149
milmazz merged 1 commit into
mainfrom
notification-test-idempotency-144

Conversation

@milmazz

@milmazz milmazz commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes the second failure in #144 (filtered notifications become requests that can be accepted) and documents why the first one can't be fixed here.

  • Accepting a notification request grants the sender a permanent NotificationPermission, so any re-run against a reused database found kadaba's mentions no longer filtered (FilterCondition#override_for_sender?) and timed out waiting for a NotificationRequest.
  • Mastodon has no API to revoke the permission directly, but BlockService destroys it (present in both v4.4.8 and v4.6.1), so the test now resets it with a block/unblock pair at the start and in on_exit, making it self-healing on reused databases.

Investigation findings for the rest of #144

  • On a truly fresh database the test passes against Mastodon 4.6.1 too — the failure reported in Two integration tests fail against Mastodon 4.6: scheduled-status idempotency (500) and filtered-notification requests #144 was leftover state, not a 4.6 behavior change.
  • The remaining failure (second POST /api/v1/statuses with the same Idempotency-Key → 500) is an upstream Mastodon 4.6 regression, still present on main: the with_idempotency refactor in PostStatusService returns the duplicate from the helper's own scope, call continues with @status = nil, and postprocess_status! crashes in ProcessHashtagsService (NoMethodError: undefined method 'account' for nil). Reproducible with plain curl. Nothing in Hunter can fix it; it blocks bumping CI toward 4.6 unless that assertion is version-guarded.

Test plan

  • Reproduced the failure on a reused 4.6.1 database (leftover permission), then verified the fixed test passes 3 consecutive runs there
  • Fresh 4.4.8 stack (CI-pinned images): full integration suite 29 tests, 0 failures

Refs #144

🤖 Generated with Claude Code

Accepting a notification request grants the sender a permanent
NotificationPermission, so any re-run against a reused database found
kadaba's mentions no longer filtered and timed out waiting for a
NotificationRequest. Mastodon exposes no API to revoke the permission
directly, but BlockService destroys it (verified on v4.4.8 and v4.6.1),
so the test now resets it via a block/unblock pair at the start and in
on_exit.

Investigation notes for the rest of #144: on a truly fresh database the
test passes against Mastodon 4.6.1 as well — the reported failure was
this leftover state, not a 4.6 behavior change. The remaining failure
(idempotency-key dedup returning 500) is an upstream 4.6 regression in
PostStatusService#with_idempotency and cannot be fixed in Hunter.

Co-Authored-By: Claude Fable 5 <[email protected]>
@milmazz
milmazz merged commit 4295c34 into main Jul 16, 2026
5 checks passed
@milmazz
milmazz deleted the notification-test-idempotency-144 branch July 16, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant