Skip to content

Group parsing fails when 'creation' field is missing from WhatsApp response #1022

@tovmeod

Description

@tovmeod

When calling GetJoinedGroups(), the parser fails with error "didn't find required attribute 'creation'" for groups where WhatsApp's API response doesn't include the creation timestamp field.

This is logged as a warning but actually is losing data, I can't get the group info

"Error parsing group 3682796@g.us: [didn't find required attribute 'creation']"

In group.go line 706, the parseGroupNode function uses UnixTime() which requires the field to exist:
If server response doesn't include the creation attribute in the group node, UnixTime() returns an error and parsing fails completely

Maybe it should change line 706 to use OptionalUnixTime() instead:

group.GroupCreated = ag.OptionalUnixTime("creation")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions