RocketChat / RocketChat/Rocket.Chat

Cache settings fetched in started() of OmnichannelTranscript to avoid repeated fetches

Open
#39,765 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: feature
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Problem

Multiple runtime settings are fetched via Promise.all inside started() of OmnichannelTranscript , with a // TODO: cache these with mem comment.
This causes repeated network/database calls on each startup or reload.

Impact

  • Increased latency at startup
  • Unnecessary load on settings service
  • Potential rate-limit or performance regressions under heavy restarts

Suggested Fix

Implement a simple cache for these settings (use the existing mem/cache service if available, or an in-memory cache with TTL):

  1. On started(), read from cache first.
  2. On cache miss, fetch with Promise.all, then store results in cache with a reasonable TTL .
  3. Provide a cache key namespace scoped to OmnichannelTranscript.
  4. Add fallback: if cache read/write fails, continue to fetch (no breaking change).

Tests

  • Unit test verifying settings are read from cache when present
  • Integration/manual test showing reduced calls to settings service across repeated starts
  • No behavioral change if cache is empty or fails

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at OmnichannelTranscript's started() method and inspect the existing mem/cache service, along with the Promise.all settings fetch described in the issue. Add tests covering cache hits, empty or failed caches, and repeated starts, then verify that settings-service calls are reduced without changing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.