When getAttachment is called via JSON-RPC with a parameter name that
doesn't match the expected 'id' key (e.g. 'attachmentId'), the
JsonRpcNamespace returns null for ns.getString("id"). This null value
propagates to AttachmentStore.retrieveAttachment() which passes it to
new File(attachmentsPath, null), causing a NullPointerException.
Add an early null/empty check that throws a descriptive IOException
instead of an opaque NPE. This makes the error actionable for JSON-RPC
clients that send an incorrect parameter name.
Co-Authored-By: Oz <oz-agent@warp.dev>
Fix type mismatch in retainAll() calls that cause updateGroup --admin
and --remove-member to silently do nothing.
retainAll() compared Set<RecipientId> against Collection<GroupMemberInfo>,
which always evaluates to false (different types), emptying the set.
Replace group.getMembers() with group.getMemberRecipientIds() in all
three affected locations.
Fixes: updateGroup --admin silently failing to promote members
Fixes: updateGroup --remove-member silently failing to remove members
Co-authored-by: joey <joey@Mac-Studio.local>
* Add --no-push flag to send command
Expose the server's `urgent` parameter so callers can skip sending a
push notification (FCM/APNs) to the recipient. The message is still
delivered in real-time over WebSocket if the recipient's app is active.
The flag is added to the Message record (following the same pattern as
viewOnce) and threaded through ManagerImpl and SendHelper, keeping the
Manager interface unchanged.
* Rename --no-push flag to --no-urgent
Align with the protocol naming as suggested by the maintainer.
The flag controls the 'urgent' parameter on the server request.