Merge branch 'develop' into feat/shopify-app-store-install-flow

This commit is contained in:
Muhsin Keloth
2026-03-30 13:13:47 +04:00
committed by GitHub
463 changed files with 48732 additions and 36060 deletions
@@ -729,6 +729,23 @@ RSpec.describe 'Conversations API', type: :request do
expect(conversation.reload.assignee_last_seen_at).not_to be_nil
end
it 'marks unread notifications as read when updating last seen' do
allow(Rails.configuration.dispatcher).to receive(:dispatch)
notification = create(:notification, account: account, user: agent, primary_actor: conversation, read_at: nil)
post "/api/v1/accounts/#{account.id}/conversations/#{conversation.display_id}/update_last_seen",
headers: agent.create_new_auth_token,
as: :json
expect(response).to have_http_status(:success)
expect(notification.reload.read_at).to be_present
expect(Rails.configuration.dispatcher).to have_received(:dispatch).with(
'notification.updated',
kind_of(Time),
hash_including(notification: have_attributes(id: notification.id))
)
end
it 'throttles updates within an hour when there are no unread messages' do
conversation.update!(agent_last_seen_at: 30.minutes.ago)
# Ensure all messages are older than agent_last_seen_at (no unread messages)