Skip to content

fix: use truthy value for emoji field on Reaction packets#4524

Merged
jamesarich merged 1 commit into
mainfrom
fix/reactions
Feb 10, 2026
Merged

fix: use truthy value for emoji field on Reaction packets#4524
jamesarich merged 1 commit into
mainfrom
fix/reactions

Conversation

@jamesarich

Copy link
Copy Markdown
Collaborator

Sets the emoji field in the DataPacket to a constant value of 1 for all reactions.

This change modifies how reactions are sent, using a fixed indicator instead of the emoji's codepoint to signify a reaction packet.

Sets the `emoji` field in the `DataPacket` to a constant value of `1` for all reactions.

This change modifies how reactions are sent, using a fixed indicator instead of the emoji's codepoint to signify a reaction packet.

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
Copilot AI review requested due to automatic review settings February 10, 2026 23:03
@github-actions github-actions Bot added the bugfix PR tag label Feb 10, 2026
@jamesarich jamesarich enabled auto-merge February 10, 2026 23:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates reaction packet construction so the DataPacket.emoji field is always set to a fixed truthy value (1) for reactions, aligning reaction signaling with the app’s reaction-detection logic (decoded.reply_id != 0 && decoded.emoji != 0).

Changes:

  • Set a constant EMOJI_INDICATOR = 1 for reaction packets sent from notification reactions (ReactionReceiver).
  • Set the same constant EMOJI_INDICATOR = 1 for reaction packets sent via service actions (MeshActionHandler).
  • Minor cleanup to use the imported DataPacket type in MeshActionHandler.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
app/src/main/java/com/geeksville/mesh/service/ReactionReceiver.kt Sends reaction DataPacket with emoji = 1 as a truthy reaction indicator.
app/src/main/java/com/geeksville/mesh/service/MeshActionHandler.kt Sends reaction DataPacket with emoji = 1 for ServiceAction.Reaction.

const val EXTRA_CONTACT_KEY = "contactKey"
const val EXTRA_TO_ID = "toId"
const val EXTRA_CHANNEL_INDEX = "channelIndex"
private const val EMOJI_INDICATOR = 1

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EMOJI_INDICATOR is duplicated here and in MeshActionHandler. Consider defining a single shared constant (e.g., a top-level REACTION_EMOJI_INDICATOR in com.geeksville.mesh.service) so the reaction-flag value can’t drift across call sites, and document that it’s a non-zero flag (not the emoji codepoint).

Copilot uses AI. Check for mistakes.

companion object {
private const val DEFAULT_REBOOT_DELAY = 5
private const val EMOJI_INDICATOR = 1

Copilot AI Feb 10, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EMOJI_INDICATOR is also defined in ReactionReceiver; having two independent definitions increases the chance of divergence. Prefer reusing a single shared constant for the reaction emoji-flag, with a short comment explaining why the value is 1 (truthy indicator vs. codepoint).

Suggested change
private const val EMOJI_INDICATOR = 1
// Reuse the shared emoji reaction flag; 1 means "has emoji reaction" (truthy), not a Unicode codepoint.
private const val EMOJI_INDICATOR: Int = ReactionReceiver.EMOJI_INDICATOR

Copilot uses AI. Check for mistakes.
@codecov

codecov Bot commented Feb 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 11.23%. Comparing base (fe5d7d6) to head (3d687c0).
⚠️ Report is 5 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...a/com/geeksville/mesh/service/MeshActionHandler.kt 0.00% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4524   +/-   ##
=======================================
  Coverage   11.23%   11.23%           
=======================================
  Files         424      424           
  Lines       14432    14432           
  Branches     2397     2397           
=======================================
  Hits         1621     1621           
+ Misses      12515    12514    -1     
- Partials      296      297    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Feb 10, 2026
Merged via the queue into main with commit fd90aa3 Feb 10, 2026
15 checks passed
@jamesarich jamesarich deleted the fix/reactions branch February 10, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix PR tag

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants