Skip to content

Comments

[receiver] unregister before registration to avoid double events#311

Merged
capcom6 merged 1 commit intomasterfrom
issue/310-double-receiver-registration
Jan 22, 2026
Merged

[receiver] unregister before registration to avoid double events#311
capcom6 merged 1 commit intomasterfrom
issue/310-double-receiver-registration

Conversation

@capcom6
Copy link
Owner

@capcom6 capcom6 commented Jan 20, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved message receiver registration stability by preventing duplicate registrations on successive initialization attempts.

✏️ Tip: You can customize this high-level summary in your review settings.

@capcom6 capcom6 linked an issue Jan 20, 2026 that may be closed by this pull request
6 tasks
@coderabbitai
Copy link

coderabbitai bot commented Jan 20, 2026

Walkthrough

Added an unregister call at the start of the MessagesReceiver.register() method to ensure any previously registered instance is unregistered before registering a new one. This prevents potential double-registration issues by performing cleanup prior to setup.

Changes

Cohort / File(s) Summary
MessagesReceiver registration cleanup
app/src/main/java/me/capcom/smsgateway/modules/receiver/MessagesReceiver.kt
Added unregister(context) call at the start of register(context) method to prevent double-registration by cleaning up any existing registration before registering again

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: unregistering before registration in the receiver to prevent double events.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch issue/310-double-receiver-registration

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🤖 Pull request artifacts

file commit
app-release.apk 53d8f1b
app-release.aab 53d8f1b
app-insecure.apk 53d8f1b
app-insecure.aab 53d8f1b

@capcom6 capcom6 added the ready label Jan 21, 2026
@capcom6 capcom6 merged commit 5521bc7 into master Jan 22, 2026
3 checks passed
@capcom6 capcom6 deleted the issue/310-double-receiver-registration branch January 22, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Webhooks are being sent twice to the server

1 participant