585 Commits

Author SHA1 Message Date
Abhinav Raut a629beaf0b resolve sql builder date filters in the app timezone instead of UTC 2026-06-18 11:56:43 +05:30
Abhinav Raut a110d38dd8 adjusts padding in filter group builder
adds comments with sample payloads to make the filter format easier to understand
2026-06-17 15:35:05 +05:30
Abhinav Raut ed0d359c2f feat: cap total filter conditions and 'in' values in query builder 2026-06-16 16:14:12 +05:30
Abhinav Raut b296b57248 feat: cap filter groups and surface a specific error when exceeded
- builder: hardcoded MaxFilterGroups (10) enforced in buildNode (validate + build paths); returns ErrTooManyGroups sentinel
- ValidateListFilters: map ErrTooManyGroups to a specific, actionable message (includes the limit); keep the generic 'Invalid filters.' for everything else so DB/internal details stay hidden
- add conversation.filters.tooManyGroups i18n key + test
2026-06-16 16:14:12 +05:30
Abhinav Raut 9b31e282c8 fix: reject empty filter values in query builder; tighten filter tree handling
- builder: error on value-requiring operators with empty value and on empty 'in' arrays instead of emitting invalid SQL (field IN ())
- filterTree: coerce array IDs to strings in toStringIdArray
- useConversationFilters: external_user_id uses TEXT operators (was SELECT)
- FilterGroupBuilder: strict two-level guard verifies group children are leaves
- drop orphaned partiallyFilled i18n key
- tests for empty 'in' and empty value rejection
2026-06-16 16:14:12 +05:30
Abhinav Raut 3247a3aa58 feat: support nested AND/OR filter groups and new fields in views 2026-06-16 16:14:12 +05:30
Abhinav Raut 15e5c35d37 renames conversation assignment funcs for clearer intent 2026-06-16 16:04:24 +05:30
Abhinav Raut 18ae7b95d6 make updateAssignee private so user assignment can't skip hooks 2026-06-16 15:58:42 +05:30
Abhinav Raut 1b87433de4 fixes autoassigner overriding a manual assignment
The autoassigner fetched the unassigned list once, then looped and
assigned each one. If the conversation was reassigned while that slow
batch was still running, the autoassigner's write still landed and
overrode it, because the UPDATE had no guard.

Adds an atomic claim that only assigns when the conversation is still
unassigned AND still in the team the user was picked from. A manual
user assignment or a team change between the list read and the claim
now makes the claim a no-op, and the side-effects (webhook, automation,
notification) are skipped. Manual assignment keeps its unconditional
override path.
2026-06-16 12:55:09 +05:30
Abhinav Raut edbc026a24 Merge pull request #359 from abhinavxd/transcript
feat: add conversation transcript download and CSAT in sidebar
2026-06-07 15:29:20 +05:30
Abhinav Raut 2d81703ae2 fix: address review nits on transcript download
- sanitize Content-Disposition filename via stringutil.SanitizeFilename to neutralize header injection
- use i18n.Tc for count-aware singular/plural attachment label
- append download anchor to DOM and defer URL.revokeObjectURL for cross-browser reliability
2026-06-07 15:17:03 +05:30
Abhinav Raut f987224cee perf: avoid DB lookups when building email From name 2026-06-07 14:45:51 +05:30
Abhinav Raut 1fccfceb4c feat: add customisable From display name template for outgoing emails
Adds a from_name_template field to email inboxes. When set and the sender is an agent, the template renders with agent and inbox variables and becomes the From display name; the inbox email address is unchanged. Any render failure, or a system-user sender, falls back to the plain inbox From so a misconfigured template never blocks delivery.

Variables: .Agent.FirstName, .Agent.LastName, .Agent.FullName, .Inbox.Name (the inbox name). Based on #249.

Co-authored-by: josephsellers <6892567+josephsellers@users.noreply.github.com>
2026-06-07 14:20:56 +05:30
Abhinav Raut eb6a195aaf feat: add conversation transcript download and CSAT in sidebar
Agents can download a full conversation as a .txt file from the
header menu. The conversation sidebar now shows the CSAT rating and
feedback once the customer responds.
2026-06-02 16:25:33 +05:30
Abhinav Raut 1233f2fbc1 fix: migrate livechat inbox lang codes to region format 2026-05-29 21:20:44 +05:30
Abhinav Raut c87c60b7c8 fix: drop contact email from incoming-message error log to keep PII out of logs 2026-05-29 21:18:54 +05:30
Abhinav Raut 870f66c229 fix: sanitize invalid UTF-8 in incoming email, fix widget scroll flicker 2026-05-29 21:00:48 +05:30
Abhinav Raut c8a5717b43 fix: filter search results by conversation read permission
Auto focus on search input
Trim search responses to 200 chars as more's not needed.
2026-05-28 21:38:57 +05:30
Abhinav Raut 5538c85749 refactor and dedup code: share conversation read-permission check across authz and ws 2026-05-28 20:16:21 +05:30
Abhinav Raut 29881f2f82 fix: close ws stale-perm gaps and resub on reconnect
Reject disabled agents in FilterAuthorizedListUUIDs, kick role members on
permission removal or role delete, and re-sub the list and open conv on
ws reconnect using local state. Also plug the app logger into the ws
package so kicks no longer log when no connections exist.
2026-05-28 20:07:19 +05:30
Abhinav Raut c87266f542 Skip ws converstion broadcast when agent is disabled 2026-05-28 19:14:19 +05:30
Abhinav Raut ddc82d9a1a fix: extract text from malformed email HTML
Swap k3a/html2text for jaytaylor/html2text in stringutil.HTML2Text.
k3a returns empty on HTML with orphan tags (e.g. stray </a>), which
made text_content blank for some emails.
2026-05-28 19:03:26 +05:30
Abhinav Raut 4f707797ad Move pvt method below public 2026-05-28 18:43:28 +05:30
Abhinav Raut 743b00ee22 fix: address PR review across stores, ws broadcast, and sticky scroll 2026-05-28 18:32:16 +05:30
Abhinav Raut 0654e3bd2f fix: skip empty incoming attachments; assign team/agent before running post message hooks this allows automations to see the conversations assigned agent & team. 2026-05-27 00:24:27 +05:30
Abhinav Raut 0a0500f29a refactor: fold widget availability broadcast into BroadcastAgentAvailability 2026-05-26 00:21:15 +05:30
Abhinav Raut 2874e78e97 fix: mark-unread no-op when latest message is a continuity email 2026-05-25 01:59:56 +05:30
Abhinav Raut 183c83b5e6 fix: prod crash from private methods, plus PR #336 review fixes 2026-05-22 21:29:57 +05:30
Abhinav Raut a502039e59 perf: WS push for conv list, store/cache cleanups, ad-hoc UI polish
Convs and messages now push the full list-row payload to perm-authorized agents on create/assign/message, so livechat returning customers bubble up instantly without waiting for the timer refresh. Background list refresh bumped 30s ->  60s as a drift safety net.
2026-05-22 20:47:36 +05:30
Abhinav Raut edc82e9e55 refactor: drop Casbin, centralize agent cache invalidation, dedupe pending SLAs 2026-05-21 21:24:42 +05:30
Abhinav Raut 33572efa04 fix: address WS PR review - stale cache retry, livechat buffer, last_active TOCTOU 2026-05-21 00:46:43 +05:30
Abhinav Raut 7a8efcde16 fix: widget ping interval, last_active flush, ws ping error, slim new_message payload 2026-05-21 00:13:33 +05:30
Abhinav Raut 43ebed1c3a WS rewrite: per-client subscriptions and perf improvements
Targets broadcasts via per-tab list and open subs (validated at subscribe time)
instead of broadcasting message uuid to all agents. Adds frontend list typing, throttled sound,
and many perf improvements to reduce cpu memory & database queries.
Other fixes: Enforce message-to-conversation binding in handleGetMessage
2026-05-20 23:42:07 +05:30
Abhinav Raut 4e13e72cc3 fix: harden media + conversation queries against empty-uuid casts 2026-05-19 14:13:56 +05:30
Abhinav Raut 5f0fed695f fix: make CSAT template insert idempotent in v2.0.0 migration 2026-05-19 11:03:48 +05:30
Abhinav Raut b15c776142 update migration to version 2.3.0 2026-05-18 18:56:31 +05:30
Abhinav Raut 4c63152c5b Rename migration file v2.2.2 to v2.3.0 2026-05-18 17:30:29 +05:30
Abhinav Raut c85cb90bef Merge pull request #317 from jleroy/i18n/update-2026-05-15
Update translations [2026-05-15] and add regions names in languages filenames
2026-05-18 15:24:43 +05:30
Jonathan Leroy 06d1c395b0 Migration (v2.2.2): Remove unused "fmt" import 2026-05-18 05:36:50 +02:00
Jonathan Leroy fdf897cc95 Migration (v2.2.2): Use parameterized queries to prevent SQL injection patterns 2026-05-18 03:05:47 +02:00
Abhinav Raut 7b1256a249 bump frontend deps and tighten image upload validation 2026-05-18 01:51:13 +05:30
Abhinav Raut 66d8c3580c fall back to image preview for inline-image-only messages 2026-05-17 17:35:31 +05:30
Abhinav Raut b014d0d9a5 resolve inline image cids on send-message response, revert f841a81f 2026-05-15 17:39:04 +05:30
Abhinav Raut f841a81f1e skip cid rewrite for private notes 2026-05-15 16:48:15 +05:30
Abhinav Raut b5000c7bc4 skip auto-reply and csat send when contact has no email 2026-05-15 16:16:32 +05:30
Abhinav Raut f6a4ad537f fix auto-replies and csat fanning out to last message's cc list
Both now send to the contact only and carry meta.is_automated so the
reply-box prefill skips them and inherits CCs from the last human message.
2026-05-15 16:16:32 +05:30
Abhinav Raut c1f80d93cb Fix: persist drafts with inline-only images
Increase orphan media GC duration to 7 days as some drafts might need them
2026-05-15 16:15:40 +05:30
Jonathan Leroy 41b5a7d7ef Fix varible assignment 2026-05-15 09:38:49 +02:00
Jonathan Leroy e78f68221d Fix missing import 2026-05-15 09:28:52 +02:00
Jonathan Leroy e0f362c14e Migrate DB to the new locale format 2026-05-15 09:21:59 +02:00