iachat/app/models/channel
Tanmay Deep Sharma 6b42ff8d39
fix: setup webhook for create and update should be done after db commit (#12176)
## Reference
https://github.com/chatwoot/chatwoot/pull/12149#issuecomment-3178108388

## Description

setup_webhook was done before the save, and hence the meta webhook
validation might fail because of a race condition where the facebook
validation is done before we saving the entry to the database.

## Type of change

Please delete options that are not relevant.

- [ ] Bug fix (non-breaking change which fixes an issue)

## How Has This Been Tested?

- New inbox creation, webhook validation
- Existing inbox update, webhook validation
- 
<img width="614" height="674" alt="image"
src="https://github.com/user-attachments/assets/be223945-deed-475a-82e5-3ae9c54a13fa"
/>


## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented on my code, particularly in hard-to-understand
areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
2025-08-13 20:53:31 +05:30
..
api.rb chore: Centralize outgoing message reply restrictions for all the channels (#11279) 2025-04-12 08:52:12 +05:30
email.rb feat: Show re-auth flag only for legacy Gmail and OAuth channels (#10189) 2024-10-02 00:51:02 -07:00
facebook_page.rb chore: Centralize outgoing message reply restrictions for all the channels (#11279) 2025-04-12 08:52:12 +05:30
instagram.rb feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
line.rb feat: Line Channel (#2904) 2021-09-11 01:31:17 +05:30
sms.rb feat: hide CSAT survey URLs from agents in dashboard (#11622) 2025-06-11 23:39:47 +05:30
telegram.rb feat(channel): add support for Telegram Business bots (#10181) (#11663) 2025-06-16 20:35:23 -07:00
twilio_sms.rb fix: Manage Twilio SMS channel via inbox API (#11457) 2025-05-15 12:28:54 +05:30
twitter_profile.rb chore: Refactor Contact Inbox Builders (#5617) 2022-10-13 15:12:04 -07:00
web_widget.rb chore: Remove defer attribute from widget-loader script (#11887) 2025-07-08 15:31:33 +05:30
whatsapp.rb fix: setup webhook for create and update should be done after db commit (#12176) 2025-08-13 20:53:31 +05:30