# Issues with @dfinity/agent polling

**URL:** <https://forum.dfinity.org/t/issues-with-dfinity-agent-polling/59177>\
**Category:** JavaScript\
**Created:** [October 21, 2025, 9:56am UTC](https://forum.dfinity.org/t/issues-with-dfinity-agent-polling/59177 "2025-10-21T09:56:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mzibara](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/mzibara/32/12850_2.png) [@mzibara](https://forum.dfinity.org/u/mzibara)\
**Post date:** [October 21, 2025, 9:56am UTC](https://forum.dfinity.org/t/issues-with-dfinity-agent-polling/59177/1 "2025-10-21T09:56:03Z")

</div>

Hey!

Plug Team has encountered issue with @dfinity/agent: 3.2.0

Most of the requests via Actor.createActor fail with Request timed out after 30000msec, however this is error thrown much faster than 30 seconds.

Interestingly enough, that if we pass

```javascript
Actor.createActor(factory, {
    pollingOptions: {
      strategy: defaultStrategy(),
    },
  })

```

And when doing polling directly just passing DEFAULT\_POLLING\_OPTIONS also fails, we override strategy like this

```javascript
const {
    pollForResponse,
    DEFAULT_POLLING_OPTIONS: { preSignReadStateRequest },
  } = polling
  await pollForResponse(agent, Principal.from(params.canisterId), requestId, {
    preSignReadStateRequest,
    strategy: defaultStrategy(),
  })

```

It seems to resolve the issue in the most cases, however we still see some logs of timeout.

Maybe you could advise us, thank you!

---

<div class="post-metadata">

**Author:** ![ilbert](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.dfinity.org/ilbert/32/8717_2.png) [@ilbert](https://forum.dfinity.org/u/ilbert)\
**Post date:** [October 21, 2025, 10:33am UTC](https://forum.dfinity.org/t/issues-with-dfinity-agent-polling/59177/2 "2025-10-21T10:33:41Z")

</div>

We fixed the issue in [`@icp-sdk/core@4.0.4`](https://js.icp.build/core/latest/changelog#404---2025-09-18) and by consequence also in [`@dfinity/agent@3.2.6`](https://www.npmjs.com/package/@dfinity/agent/v/3.2.6).

Here’s the PR containing the fix:

> <https://github.com/dfinity/icp-js-core/pull/1149>
>
> \# Description
> 
> Setting the \`defaultStrategy()\` on the \`DEFAULT\_POLLING\_OPTIONS…\` statically results in calling the \`timeout\` strategy in the chain and starting the timeout. This makes all the read state requests after update calls fail after the configured \`FIVE\_MINUTES\_IN\_MSEC\`, no matter whether the polling already started or not. This PR fixes the bug by removing the \`defaultStrategy()\` on the \`DEFAULT\_POLLING\_OPTIONS\` and setting it in the \`pollForResponse\` call.
> 
> Ideally, the strategy property in the \`pollingOptions\` should be a function that returns a \`PollStrategy\`, but that was unfortunately changed in https://github.com/dfinity/icp-js-core/commit/880f18e11b74fae6a4005622c609c78a709afabe#diff-8e88073ceeb119a7b39f3e6616db4c23f5d3c0e923c194f1f0e5a1a6d54f5835L99. It would require us to make a breaking change, which is not viable at the moment.
> 
> Additionally, removes the \`PollStrategyFactory\` type, which was not used anywhere.
> 
> \# How Has This Been Tested?
> 
> Added unit tests
> 
> \# Checklist:
> 
> \- \[x\] My changes follow the guidelines in \[CONTRIBUTING.md\](https://github.com/dfinity/icp-js-core/blob/main/.github/CONTRIBUTING.md).
> \- \[x\] The title of this PR complies with \[Conventional Commits\](https://www.conventionalcommits.org/en/v1.0.0/).
> \- \[x\] I have edited the CHANGELOG accordingly.
> \- \[x\] I have made corresponding changes to the documentation.

Can you please try bumping the version of the `@dfinity/agent` package and let us know if the issue is fixed?
