iachat/spec/builders/v2/reports
Vinay Keerthi 059506b1db
feat: Add automatic favicon fetching for companies (#13013)
## Summary

This Enterprise-only feature automatically fetches a favicon for
companies created with a domain, and adds a batch task to backfill
missing avatars for existing companies. The flow only targets companies
that do not already have an attached avatar, so existing avatars are
left untouched.


## Demo 



https://github.com/user-attachments/assets/d050334e-769f-4e46-b6e7-f7423727a192



## What changed

- Added `Avatar::AvatarFromFaviconJob` to build a Google favicon URL
from the company domain and fetch it through `Avatar::AvatarFromUrlJob`
- Triggered favicon fetching from `Company` with `after_create_commit`
- Added `Companies::FetchAvatarsJob` to batch existing companies that
are missing avatars
- Added `companies:fetch_missing_avatars` under `enterprise/lib/tasks`
- Kept the company-specific implementation inside the Enterprise
boundary
- Stubbed the new favicon request in unrelated specs that now hit this
callback indirectly
- Updated a couple of CI-sensitive specs that were failing due to
callback side effects / reload-safe exception assertions

## How to verify

1. Create a company in Enterprise with a valid domain and no avatar.
2. Confirm that a favicon-based avatar gets attached shortly after
creation.
3. Create another company with a domain and an avatar already attached.
4. Confirm that the existing avatar is not replaced.
5. Run `companies:fetch_missing_avatars`.
6. Confirm that existing companies without avatars get one, while
companies that already have avatars remain unchanged.

## Notes

- This change does not refresh or overwrite existing company avatars
- Favicon fetching only runs for companies with a present domain
- The branch includes the latest `develop`

---------

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
2026-03-05 18:51:28 -08:00
..
conversations chore: upgrade ruby version to 3.4.4 (#11524) 2025-05-21 19:40:07 +05:30
timeseries fix: resolution count does not have account scope (#12370) 2025-09-04 18:04:00 +05:30
agent_summary_builder_spec.rb feat(v4): Update team, agent summary builder to include resolution metrics (#10607) 2024-12-20 19:16:56 +05:30
bot_metrics_builder_spec.rb feat: Add backend APIs for the bot metrics (#9031) 2024-03-01 08:20:20 -08:00
channel_summary_builder_spec.rb feat: Add an API to support querying metrics by ChannelType (#13255) 2026-01-12 23:18:47 -08:00
first_response_time_distribution_builder_spec.rb feat: Add first response time distribution report endpoint (#13400) 2026-01-30 22:22:27 +04:00
inbox_label_matrix_builder_spec.rb feat: Add inbox-label matrix report endpoint (#13394) 2026-01-29 13:32:59 -08:00
inbox_summary_builder_spec.rb feat: Instagram Inbox using Instagram Business Login (#11054) 2025-04-08 10:47:41 +05:30
label_summary_builder_spec.rb feat: Add automatic favicon fetching for companies (#13013) 2026-03-05 18:51:28 -08:00
team_summary_builder_spec.rb feat(v4): Update team, agent summary builder to include resolution metrics (#10607) 2024-12-20 19:16:56 +05:30