Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [Unreleased]

- The item tag push plays the default sound (`sound: "default"` in `ItemTagNotifier`): without `aps.sound` iOS showed it silently. FCM gets the same `sound`; Android 8+ still follows the `item_tag_completed` channel
- Security: `PUT`/`PATCH /shopkeeper_auth/password` needs the reset link's `reset_password_token`. With `require_client_password_reset_token`, devise_token_auth's update never checks the current password, so a request signed in with just the access token changed the password without the old one; sent with a `current_password`, it failed with a 500. Without the token the request now gets 401; only the reset page's form posts here, and the apps change the password with `PATCH /api/v1/shopkeeper/account/password`, which asks for the current one. The check reads the value the gem reads, so a token sent as an array or a hash cannot slip past it. Ported from myturntagapi #231, where it was found

## 2026-10-29
Expand Down
4 changes: 3 additions & 1 deletion app/notifiers/item_tag_notifier.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ class ItemTagNotifier < ApplicationNotifier
config.format = -> {
{
title: title,
body: body
body: body,
# iOS plays no sound without aps.sound in the payload
sound: "default"
}
}
# No url: the apps open no screen for an item tag
Expand Down
12 changes: 12 additions & 0 deletions test/notifiers/item_tag_notifier_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ class ItemTagNotifierTest < ActiveSupport::TestCase
assert_equal({}, notification.instance_exec(&ItemTagNotifier.delivery_methods[:action_push_native].config[:with_data]))
end

# Without a sound APNs shows the alert silently: iOS plays no sound when the
# payload has no aps.sound, even with the .sound authorization. Found on an
# iPhone against the local development server (release checklist, record 21)
test "the push plays the default sound" do
ItemTagNotifier.with(record: @item_tag).deliver(@shopkeeper)
notification = @shopkeeper.notifications.last
format = notification.instance_exec(&ItemTagNotifier.delivery_methods[:action_push_native].config[:format])

assert_equal "default", format[:sound]
assert_equal "default", ApplicationPushNotification.new(**format).sound
end

test "action_push_native delivery performs without raising" do
ApplicationPushDevice.create!(owner: @shopkeeper, platform: "apple", token: "test-token")

Expand Down
Loading