Skip to content

Share subnet key across parallel query calls #1179

@sea-snake

Description

@sea-snake

It seems fetching subnetkeys in agent-js is indeed cached but this cache is not shared yet when making multiple query calls in parallel.

Maybe the cache could contain Promise instead of SubnetKey so multiple query calls in parallel only need a single read_state request?

For the average dev, having it re-use the same request when making the first queries in parallel would be nice improvement.

For whomever comes across this issue, you can explicitly pre-cache the subnet keys by calling agent.fetchSubnetKeys() on page load, this avoids the need for them to be fetched on the first query triggered by a user interaction.

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