Skip to content

The composer should throw a helpful error message on duplicate transactions #366

@joe-p

Description

@joe-p

Problem

If a developer tries to send multiple of the same transactions in the same group the group will get rejected because of duplicate transactions. This is exasperated by the caching of suggestedParams (which is largely a good change) which might be non-obvious to developers who are used to each txn getting new suggestedParams (thus different fv/lv).

For example:

appClient
        .newGroup()
        .gas({ args: {}})
        .gas({ args: {}})
        .gas({ args: {}})
        .gas({ args: {}})

Solution

Proposal

If the composer detects multiple transactions in the same group it should throw an error with a descriptive error message of what happened. This error message should mention cached params, how to invalidate the cache, and/or how to use txn fields to make transactions unique.

Pros and Cons

Non breaking change with a more descriptive error message

Dependencies

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions