fixthestatusquo / fixthestatusquo/proca-sync

Campaign cache not reflecting updates

Open
#285 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
3
Forks
2
PR merge metrics
No merged PRs in 30d

Description

## Context:
We fetch some sync-related variables from the campaign config using:

`const camp = await this.campaign(message.campaign)`

To improve performance, the campaign is cached so we don’t fetch it for every action.

## Problem:
The cache is not invalidated or refreshed after a campaign is updated.
This means that if a user modifies campaign settings after the first action is taken, the updated values, in most cases, will not be respected.

## Expected behavior:
When a campaign is updated, we should clear the cached value and refetch it to ensure the latest configuration is used.

## Solution:
At the CRM level, listen for a campaign_updated event.
When that event is received, clear the campaign cache and refetch the campaign on the next access.
(Note: We need custom events activated on an org level.)

-----------------

**Possible larger issue**: For a certain type of confirmation (e.g., a client-side action confirmation used in `activecampaign.ts`), events are going to the` deliver` queue, and we are taking actions from `confirm.supporter`

The case where the campaign update is somewhat solved (hack): `cleverreach.ts`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the campaign cache and CRM event-handling entry points, then inspect activecampaign.ts and cleverreach.ts for how campaign updates and confirmations are currently handled. Trace whether campaign_updated events reach the relevant queue and confirm that an updated campaign is fetched on the next access; the cache-refresh behavior and the event path should be covered by existing or newly located tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.