Skip to content

Campaign cache not reflecting updates #285

@1v4n4

Description

@1v4n4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions