<p dir="auto"><strong>Do you want to request a <em>feature</em> or report a <em>bug</em>?</strong><br>
Bug</p>
<p dir="auto"><strong>What is the current behavior?</strong><br>
When rendering with a suspense config, time spent before rendering appears to be subtracted from the timeout of the suspense config. If I spend 1 second before triggering an update with a suspense config with a timeout of 2 seconds, it takes only 1 second before the tree suspends.</p>
<p dir="auto"><strong>If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (<a href="https://jsfiddle.net/Luktwrdm/" rel="nofollow">https://jsfiddle.net/Luktwrdm/</a>) or CodeSandbox (<a href="https://codesandbox.io/s/new" rel="nofollow">https://codesandbox.io/s/new</a>) example below:</strong></p>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Open PR with failing test (<a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="502547950" data-permission-text="Title is private" data-url="https://github.com/facebook/react/issues/17015" data-hovercard-type="pull_request" data-hovercard-url="/facebook/react/pull/17015/hovercard" href="https://github.com/facebook/react/pull/17015">#17015</a>)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> Create CodeSandbox with example (<a href="https://codesandbox.io/s/suspense-config-test-sw3fn" rel="nofollow">https://codesandbox.io/s/suspense-config-test-sw3fn</a>)<br>
In the sandbox, any time spent before click "Next page", reduces the time the pending state is shown before suspending. If you wait longer than 2 seconds, it immediately suspends.</li>
</ul>
<p dir="auto"><strong>What is the expected behavior?</strong><br>
I would expect the timeout of the suspense config to count from when the update is triggered.</p>
<p dir="auto"><strong>Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?</strong><br>
Any version that allows rendering with a suspense config</p>
<p dir="auto">I was playing around with some unstable Suspense APIs and noticed this strange behaviour when using <code class="notranslate">React.unstable_withSuspenseConfig</code>.</p>
<p dir="auto">If I understood correctly, the purpose of <code class="notranslate">timeoutMs</code> field is to tell React: "I'm okay with this update to not happen within this time. <em>Then</em> you can show fallback."</p>
<p dir="auto">What it actually says is: "I'm okay with this update to not happen within this time <em>since previous update</em>." Meaning if nothing happened for some time, fallback will show up immediately.</p>
<p dir="auto">Here's this case reproduced in sandbox: <a href="https://codesandbox.io/s/romantic-chebyshev-n59dk" rel="nofollow">https://codesandbox.io/s/romantic-chebyshev-n59dk</a></p>
<p dir="auto">Fun thing I noticed: it works as expected if I repeatedly perform updates anywhere in my App. So it may be hard to catch in real world.</p>
<p dir="auto">My (unfamiliar with codebase) theory is that expiration time for my update is based on last update (commit?) time, but should've been based on the time it was triggered??</p>
<p dir="auto">I know that this is unstable API and I might be misunderstanding something. Hope my case helps!</p>
<hr>
<p dir="auto">React 16.10.1<br>
Tested on MacOS 10.4: Safari 13.0.1, Chrome 77</p>