Skip to content

getReactions returns stale data for older messages unless they are manually rendered in UI #2728

Description

@reko-0

Description

I am using WPPConnect to export message history and reactions into a JSON file for data analysis. When I fetch older messages (e.g., 30+ days old) using getMessages and then call getReactions(msg.id), the returned reactions are often missing or outdated.

However, if I manually scroll through the chat in the browser to the specific message, the reactions suddenly update, and subsequent calls to getReactions (or my export script) then return the correct data.

It seems getReactions only queries the local Store, which is not synchronized for "inactive" (off-screen/old) messages.

YourCode

// Simplified version of my script
const messages = await client.getMessages(CHAT_ID, { count: -1 });
const recentMessages = messages.filter(m => m.timestamp >= START_DATE);

for (const msg of recentMessages) {
    // This returns stale or empty data for old messages 
    // even if they have reactions on the server
    const reactionsData = await client.getReactions(msg.id); 
    console.log(msg.id, reactionsData);
}

Expected behavior

There should be a way to force WPPConnect/WA-JS to request the latest reaction metadata from WhatsApp servers for a specific message ID, even if the message is not currently "active" or visible in the DOM.

Current Workaround

Manually scrolling up in the headless browser until the message is visible, which is not viable for large-scale data extraction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions