This PR addresses several items listed in our rubocop_todo by implementing the necessary corrections and enhancements. As a result, we are now able to remove the rubocop_todo file entirely, streamlining our codebase and ensuring adherence to our coding standards.
fixes: https://linear.app/chatwoot/issue/CW-1806/chore-rubocop-audit
We observed an issue in production where the external webhook for an API inbox was failing. This, in turn, calls message update to update message status to failed. This causes a loop because rails trigger after_update callbacks even for empty commits.
Ref: rails/rails#44500
This PR logs additional information in content_attributes of a message in case it is unsupported. This info can be used by the client to render a fresh UI
Updating the `unattended` tab to include conversations where the customer responded and is awaiting an agent's response.
Previously it showed only the conversations where the first response was pending.
Co-authored-by: Pranav Raj S <pranav@chatwoot.com>
- This renames the unread_since scope to created_since, which more accurately describes what the scope returns.
- The EXTRACT(EPOCH FROM created_at) > (?) clause was also simplified and rewritten as created_at > ?, which is equivalent:
* logging the messages id for message validation exception
* Update the processed_message_content validation over length
* codeclimate
* specs failing for contacts
- Add JsonSchemaValidator, which takes a declarative schema and validates it for a given property.
- Add specs for JsonSchemaValidator
- Enable the validator for template_params
- Strip search term before searching
- order messages by created_at desc
- order contacts by last_activity_at desc
- order conversations by created_at desc
- Search only resolved contacts
- Optimize resolved contacts query
ref: #6583
* feat: ignore bots in avg_first_response_time
* feat: ignore bots in avg_first_response count
* feat: add bot handoff event
* feat: add handoff event listener and reporting event
* fix: ignore agent bot in first response
* refactor: calculate first_response with last handoff
* refactor: method defn order
* test: new reporting events
* feat: Revert "feat: ignore bots in avg_first_response count"
This reverts commit de1977c219a2e7a9180dd02272244fe3b3f7ce89.
* feat: Revert "feat: ignore bots in avg_first_response_time"
This reverts commit bb9171945d5e3b2f6015f4f96dd1b76b3efb6987.
* fix: business hour calculation for first_reply
* fix: event_start_time for first_response
* feat: add migration to recompute first_responses
* refactor: separate mute helpers for conversation
* refactor: rename migration
* refactor: migration script
* fix: migration typo
* fix: typo in query
* feat: update schema.rb
* Revert "feat: update schema.rb"
This reverts commit 353ef355f2d956dd219907bb66982dc90ca5d896.
* feat: update schema
* refactor: update events as a batch job
* fix: ignore the event if value is negative
* feat: don't create a new hand-off if it's already present
* refactor: break the action into smaller chunks
* refactor: update reporting listener spec
Handle the case to ensure extra bot handoffs are not created for a give conversation
* fix: import error
---------
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
* fix: Update unread_count from backend instead of computing on the frontend
* Fix spec
* Remove status indicator on private notifications
* CodeClimate fix
* CodeClimate
When a user mentions the connected Instagram page in a story, the story's content is downloaded in Chatwoot, then if the user deletes the story, the content persists in the platform.
fixes: #5258