Skip to content

Conversation

@nijeesh-stream
Copy link
Contributor

@nijeesh-stream nijeesh-stream commented Mar 20, 2025

Submit a pull request

CLA

  • I have signed the Stream CLA (required).
  • The code changes follow best practices
  • Code changes are tested

Description of the pull request

This PR adds support for the show_deleted_message option in the get_message API. This feature allows retrieving deleted messages when explicitly requested.

Changes Made

  1. Added support for the show_deleted_message option in the get_message method
  2. Added comprehensive test cases to verify the functionality:
    • Basic message retrieval
    • Retrieving deleted messages with show_deleted_message: true
    • Retrieving non-deleted messages with show_deleted_message: true

Test Cases

The following test cases have been added to verify the functionality:

 it 'gets message by id' do
      response = @client.get_message(@msg_id)
      message = response['message']
      expect(message['id']).to eq(@msg_id)
    end

    it 'gets deleted message when show_deleted_message is true' do
      response = @client.get_message(@deleted_msg_id, show_deleted_message: true)
      message = response['message']
      expect(message['id']).to eq(@deleted_msg_id)
    end

    it 'also it gets non-deleted message when show_deleted_message is true' do
      response = @client.get_message(@msg_id, show_deleted_message: true)
      message = response['message']
      expect(message['id']).to eq(@msg_id)
    end

Implementation Details

The get_message method now accepts an optional show_deleted_message parameter that is passed through to the API. This allows users to:

  1. Retrieve deleted messages when needed
  2. Maintain backward compatibility with existing code
  3. Have explicit control over whether deleted messages should be included in the response

Testing

All tests have been run and passed successfully. The test suite includes:

  • Unit tests for the new functionality
  • Integration tests to verify API behavior
  • Edge cases for both deleted and non-deleted messages

Documentation

The changes maintain the existing documentation style and include:

  • Method signature updates
  • Parameter descriptions
  • Usage examples in the test cases

Breaking Changes

None. This is a backward-compatible enhancement that adds new functionality without modifying existing behavior.

@nijeesh-stream nijeesh-stream force-pushed the CHA-768_get_message_options branch from e32ec42 to 1ed8cdd Compare March 20, 2025 12:36
@nijeesh-stream nijeesh-stream merged commit d62a54b into master Mar 21, 2025
4 checks passed
@nijeesh-stream nijeesh-stream deleted the CHA-768_get_message_options branch March 21, 2025 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants